From a76884513a36ffc15e245ad4e149dfa3d538f4ec Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Thu, 20 Oct 2005 11:20:41 +0000 Subject: [PATCH] minor fixes for valgrind git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7695 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Examples/test-suite/import_nomodule.i | 1 + Examples/test-suite/inherit_missing.i | 1 + Examples/test-suite/python/Makefile.in | 1 + Examples/test-suite/python/director_thread.i | 11 ++++++++--- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Examples/test-suite/import_nomodule.i b/Examples/test-suite/import_nomodule.i index 67828a2f3..37407ce33 100644 --- a/Examples/test-suite/import_nomodule.i +++ b/Examples/test-suite/import_nomodule.i @@ -17,6 +17,7 @@ * fixable (needs more investigation). */ +%newobject create_Foo; %inline %{ Foo *create_Foo() { return new Foo(); diff --git a/Examples/test-suite/inherit_missing.i b/Examples/test-suite/inherit_missing.i index 46356dcac..2a9ec7b67 100644 --- a/Examples/test-suite/inherit_missing.i +++ b/Examples/test-suite/inherit_missing.i @@ -18,6 +18,7 @@ public: class Foo; +%newobject new_Foo; %inline %{ class Bar : public Foo { diff --git a/Examples/test-suite/python/Makefile.in b/Examples/test-suite/python/Makefile.in index 32122943a..3717d9fa9 100644 --- a/Examples/test-suite/python/Makefile.in +++ b/Examples/test-suite/python/Makefile.in @@ -4,6 +4,7 @@ ####################################################################### LANGUAGE = python +#PYTHON = valgrind --leak-check=full --show-reachable=yes @PYTHON@ PYTHON = @PYTHON@ SCRIPTSUFFIX = _runme.py srcdir = @srcdir@ diff --git a/Examples/test-suite/python/director_thread.i b/Examples/test-suite/python/director_thread.i index 0c7cdb5a2..475c18369 100644 --- a/Examples/test-suite/python/director_thread.i +++ b/Examples/test-suite/python/director_thread.i @@ -15,12 +15,17 @@ extern "C" void* working(void* t); class Foo { public: int val; - Foo() : val(0) {} + pthread_t *t; - virtual ~Foo() {} + Foo() : val(0) { + t = new pthread_t; + } + + virtual ~Foo() { + delete t; + } void run() { - pthread_t *t = new pthread_t; pthread_create(t,NULL,working,this); sleep(5); }