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
Posts: 16,676
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: How to hunt down a segfault?

I have to initialize all pointers with NULL.
That seems to be the reason for the whole mess. I will do that for all my materials and check back, but it seems to have resolved this issue.

There should be a big sign for java developers going c++ with stuff like that, placed conviniently above my monitor...

Thank you for your patience BGmot!
Let's see if that resolves everything :smileyhappy:
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook
My Carrier: x

Re: How to hunt down a segfault?

I am afraid I was misunderstood.

I personally *do* initialize all my pointers with NULL or real values.

And I *do* expliciltely set them to NULL when objects they point to are deleted.

Some may argue that this does not make sense though... to me it is just cleaner code and checks for NULL often help.

Developer
Posts: 16,676
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: How to hunt down a segfault?

Well, i did not initialize pointers with 0, i assumed that unless i put an object there it would be null.
I should have thought about that, as i read about bool being able to have three values and int variables having a value on their own, but alas, i did not.

So, to conclude:
kids, initialize all pointers with NULL (or 0). Especially if you are a java developer that has a whole other concept of it.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter