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
bskania
Posts: 105
Registered: ‎04-24-2012
My Device: blackberry developer
Accepted Solution

App crash on tap gesture event in bb10

Hello

 

I am developing one application which is showing images one by one.

To handle that I had taken the touchevent and according to point next and previous image is shown.

But in that only while user encounters the tap event I am showing the information regarding the image in the custom dialog.

While handling this thing sometime app continuously crashes.

 

Any one is encountering this kind on propblem in latest bb10 realese.

 

Thanks in advance.

Please use plain text.
BlackBerry Development Advisor (Retired)
smacmartin
Posts: 499
Registered: ‎05-07-2012
My Device: developer

Re: App crash on tap gesture event in bb10

[ Edited ]

How much progress have you made in your own debugging?

- what's the stack trace where you crash?

- have you checked that the object you are using is valid?

- have you got any trace?

- have you verified that all your own objects are properly created?

- have you double-checked that objects you are trying to use haven't been deleted?

- does this happen right away or only the 2nd time you process an image, or the 1000th?  Is there a pattern that might lead you to where the crash is?

 

Based on what you've said so far, the problem is highly likely in your code.  If you are stuck or suspect a cascades bug, can you provide a bit more context, code, debug trace, and the like?

 

Stuart

Please use plain text.
Developer
bskania
Posts: 105
Registered: ‎04-24-2012
My Device: blackberry developer

Re: App crash on tap gesture event in bb10

Hello I had debugged my code.
But its not giving me any specific error. while I am debugging the code the crash is never happened.
I had also checked that the object is deleted or not?
this problem happens sometime continuously and sometime the app will work for 100 times correctly.

So I am not able to get exactly what is my mistake? Or is this problem while handling gesture events in the BB10.

Still Today I will try to again trace my code and will update.
Bskania.
Please use plain text.
BlackBerry Development Advisor (Retired)
smacmartin
Posts: 499
Registered: ‎05-07-2012
My Device: developer

Re: App crash on tap gesture event in bb10

This kind of bug can be very difficult to track down :smileysad:

Often it is a memory overwrite, an uninitialized variable, object used after being deleted but the memory is still somewhat valid, a specific sequence that must be hit, or coordination between threads.  There are tools to help track down memory issues.  You might want to spend some time writing defensive code and just sanitizing your code: in every constructor of yours, make sure you initialize all integers, doubles and pointers (even if you set the values later in the body or an Init function).  Every place that can return 0, e.g. findChild or dynamic_cast, check if the returned pointer is 0 and log if it is.

 

To get some idea of where it might lie, sometimes I just add conditional-compile logging at the top of routines.  Then I can trace what went on just before the crash.  In your case, since gesture support is involved, I'd focus on exactly what is going on in that handling, and have your code report the moment something unusual happens.

 

Good luck.

 

Stuart

Please use plain text.
Developer
bskania
Posts: 105
Registered: ‎04-24-2012
My Device: blackberry developer

Re: App crash on tap gesture event in bb10

My problem is solved. Its a memory allocation issue.

Please use plain text.