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:
parent
05431cbfc0
commit
959aa385f5
7 changed files with 137 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue