Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Super Contributor
JeffLemon
Posts: 440
Registered: ‎01-13-2011
My Device: Playbook
My Carrier: NA

App crashing upon delete?

I have the following to delete a page when my class is deleted:

 

MyClass::~MyClass()
{
	delete page;
}

 The problem is, it crashes the app:

Process 38170770 (MyApp) terminated SIGSEGV code=1 fltno=11 ip=79b1fb9a(/base/usr/lib/qt4/lib/libQtCore.so.4.8.4@_ZN7QObjectD1Ev+0x29) mapaddr=0011fb9a. ref=00000010 bdslot=1

 

Does anyone know why?

 

 

--------------------------------------------------------------------------------------------------
BlackBerry Apps: Instruments | ARTPAD | Piano | Drums | Xylophone
Please use plain text.
Developer
Zmey
Posts: 1,512
Registered: ‎12-18-2012
My Device: PlayBook, Z10, DAC

Re: App crashing upon delete?

In Qt/Cascades just set the parent and the objects will be deleted automatically when parent object is destroyed. Calling delete manually is rarely needed.
For this to work objects must inherit from QObject or it's subclasses.

For troubleshooting this issue please post more code: how the page is created and where it's used.

Andrey Fidrya, @zmeyc on twitter
Please use plain text.