minor fixes for valgrind

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7695 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2005-10-20 11:20:41 +00:00
commit a76884513a
4 changed files with 11 additions and 3 deletions

View file

@ -17,6 +17,7 @@
* fixable (needs more investigation). * fixable (needs more investigation).
*/ */
%newobject create_Foo;
%inline %{ %inline %{
Foo *create_Foo() { Foo *create_Foo() {
return new Foo(); return new Foo();

View file

@ -18,6 +18,7 @@ public:
class Foo; class Foo;
%newobject new_Foo;
%inline %{ %inline %{
class Bar : public Foo { class Bar : public Foo {

View file

@ -4,6 +4,7 @@
####################################################################### #######################################################################
LANGUAGE = python LANGUAGE = python
#PYTHON = valgrind --leak-check=full --show-reachable=yes @PYTHON@
PYTHON = @PYTHON@ PYTHON = @PYTHON@
SCRIPTSUFFIX = _runme.py SCRIPTSUFFIX = _runme.py
srcdir = @srcdir@ srcdir = @srcdir@

View file

@ -15,12 +15,17 @@ extern "C" void* working(void* t);
class Foo { class Foo {
public: public:
int val; int val;
Foo() : val(0) {} pthread_t *t;
virtual ~Foo() {} Foo() : val(0) {
t = new pthread_t;
}
virtual ~Foo() {
delete t;
}
void run() { void run() {
pthread_t *t = new pthread_t;
pthread_create(t,NULL,working,this); pthread_create(t,NULL,working,this);
sleep(5); sleep(5);
} }