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
Developer
SuhairZain
Posts: 123
Registered: ‎09-18-2013
My Device: Dev Alpha B
Accepted Solution

Deallocating Using delete operator

hi, i create my ui as well as logic using c++ only. so, there's a lot of need to use pointers. i use the new operator as well as the builder functions to initialize these pointers. do i need to deallocate the pointers that were initialized using builder functions such as Container::create(); ?

Developer
BBSJdev
Posts: 6,116
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

Re: Deallocating Using delete operator

Yes and No. :smileyhappy:

 

If you have parented the object then you do not need to as when the parent object is deleted then so are all the child objects.

 

If you do not set the parent then you will need to manually delete.

 


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Developer
SuhairZain
Posts: 123
Registered: ‎09-18-2013
My Device: Dev Alpha B

Re: Deallocating Using delete operator

Alright. Is this the reason why I get a message like this in my console every time I close my app:
Error:Context DockLayout [Objectid=45] not unrealized
Developer
BBSJdev
Posts: 6,116
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

Re: Deallocating Using delete operator

No, these are BlackBerry internal warnings and as long as your app doesn't crash can safely be ignored.

As long as you believe you are deallocating memory correctly as discussed above.

 


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Developer
SuhairZain
Posts: 123
Registered: ‎09-18-2013
My Device: Dev Alpha B

Re: Deallocating Using delete operator

That was the only error messages I was getting. If they are not a prob, its ok. Thanks. :smileyhappy: