Correct test for global shared_ptr variable

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10343 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2008-04-04 23:26:54 +00:00
commit a37115f55d
5 changed files with 13 additions and 17 deletions

View file

@ -24,12 +24,12 @@ namespace SharedPtrWrapper {
template<typename T> void increment(boost::shared_ptr<T>* ptr) {
SwigExamples::Lock lock(critical_section);
std::cout << ptr << " " << show_message(ptr) << " " << " +" << std::endl << std::flush;
std::cout << "====SharedPtrWrapper==== + " << ptr << " " << show_message(ptr) << " " << std::endl << std::flush;
total_count++;
}
template<typename T> void decrement(boost::shared_ptr<T>* ptr) {
SwigExamples::Lock lock(critical_section);
std::cout << ptr << " " << show_message(ptr) << " " << " -" << std::endl << std::flush;
std::cout << "====SharedPtrWrapper==== - " << ptr << " " << show_message(ptr) << " " << std::endl << std::flush;
total_count--;
}
static int getTotalCount() { return total_count; }