Created DestroyListener class.

This class is used to keep the Python object live until the signal destroyed emission.

With this is possible to use the QObject on destruction signal.

Fixes bug #505.

Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
          Hugo Parente Lima <hugo.pl@gmail.com>
This commit is contained in:
Renato Filho 2011-05-23 11:39:17 -03:00 • committed by Hugo Parente Lima
commit 77559ac639
7 changed files with 137 additions and 0 deletions

View file

@ -31,6 +31,7 @@
#include "pysidemetafunction_p.h"
#include "pysidemetafunction.h"
#include "dynamicqmetaobject.h"
#include "destroylistener.h"
#include <basewrapper.h>
#include <conversions.h>
@ -101,10 +102,12 @@ void registerCleanupFunction(CleanupFunction func)
void runCleanupFunctions()
{
//PySide::DestroyListener::instance()->destroy();
while (!cleanupFunctionList.isEmpty()) {
CleanupFunction f = cleanupFunctionList.pop();
f();
}
PySide::DestroyListener::destroy();
}
static void destructionVisitor(SbkObject* pyObj, void* data)