Not sure what you mean. example implementation code: Code: MyClass::MyClass(QObject* parent) : QObject(parent) // Not passing the parent to the QObject base will also result in memory leakage { mySubObject = new QObject(this); // Will be deleted when "MyClass" dies myLeakObject = new QObject; // Will live forever }
MyClass::MyClass(QObject* parent) : QObject(parent) // Not passing the parent to the QObject base will also result in memory leakage { mySubObject = new QObject(this); // Will be deleted when "MyClass" dies myLeakObject = new QObject; // Will live forever }