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: 49
Registered: ‎06-06-2012
My Device: Bold 9700
My Carrier: Pelephone

Re: Application did not handle 'exit' message and was slayed

Two comments:

 

1. Can we deduce from this that the message is not an indication of an error in our app? That would be nice... :-)

 

2. It can take a long time for the app to become usable again after the message has been dismissed, so the inconvenience is a bit more than just the popup itself... :-(

 

Thanks for the update,

 

Jamie

Retired
Posts: 329
Registered: ‎05-07-2012
My Device: BB Alpha
My Carrier: N/A

Re: Application did not handle 'exit' message and was slayed

Throughout the Beta phases of Cascades, I cannot confirm 1.

 

As for 2, I understand and agree that it is a nuisance - best bet for the moment would be to create a bug report as it is impacting your development efforts-

 

Cheers,

 

Martin

 

Developer
Posts: 49
Registered: ‎06-06-2012
My Device: Bold 9700
My Carrier: Pelephone

Re: Application did not handle 'exit' message and was slayed

EUREKA!

 

First of all, attached is a small app, which demonstrates the issue.

 

Secondly, as noted above, the popup about the app not handling 'exit' is just a side-effect of an exception being thrown while the app is closing. As such, the causes of such an exception can be many. What I describe here is simply the issue, which plagued me. Others encountering the same popup will likely find other causes.

 

In my case, the following error messages provide a clue:

 

ERROR: Context: Object name=" "ImageData" " [objectId= 10 ] not unrealized
ERROR:: ClientContext: Destroying server context with 1 remaining objects!
ERROR:: ClientContext: Releasing remaining objects...
### PPS Thread: FINISHED
### Server Thread: FINISHED
QNXApplicationEngineImpl::run(EXIT)
ApplicationPrivate::resourceManager: ERROR called from non-UI thread QThread(0x12fe30)
ApplicationPrivate::resourceManager: Method called from non-UI thread

 

It seems that some types have to be destructed before main has exited. When might this not happen?

Well, sometimes I like to use singletons. In my implementation, the singleton object is instantiated like this:

 

Singleton& Singleton::instance()
{
    static Singleton singleton;
    return singleton;
}

 

Such instances are destructed by the C++ cleanup code, which is executed AFTER main has exited. Apparently this is too late for some Cascade types (e.g., "Image" in my sample).

 

The solution I used to overcome this was to destruct all such sensitive objects while the UI thread is still active. I did this by connecting to the application's "aboutToQuit" signal. This solved the issue for me.

 

In the attached sample, the solution is commented-out. You can un-comment it to see how it works.

 

Cheers,

 

Jamie

Retired
Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: Application did not handle 'exit' message and was slayed

I had noticed that the issue happened during the destruction of statics.

It also seemed that sometimes the issue happened before main() returned, while cleaning up objects on the stack.

 

In your case, what kind of object needed to be cleaned up earlier?

 

Stuart

Developer
Posts: 323
Registered: ‎05-07-2009
My Device: BlackBerry Z10, PlayBook, 9900
My Carrier: Telus

Re: Application did not handle 'exit' message and was slayed

Since getting the latest DevAlpha update (released today) I have not seen this error anymore.  Its only been about 20 minutes... but I think this issue may have been fixed. ;-)


PlayBook Apps: DataMine, Dots + Boxes, 5 Marbles
BlackBerry SmartPhone Apps: 5 Marbles Soon: **** (D.Z.A), ****Quest, **** Challenge, VaultCracker, DevBrowser, Radial****
Developer
Posts: 49
Registered: ‎06-06-2012
My Device: Bold 9700
My Carrier: Pelephone

Re: Application did not handle 'exit' message and was slayed

The object was an instance of "Image".

Developer
Posts: 49
Registered: ‎06-06-2012
My Device: Bold 9700
My Carrier: Pelephone

Re: Application did not handle 'exit' message and was slayed

Steve,

 

I'm on 10.0.6. What version was released today?

 

Please note that while the popup may no longer be showing in the latest release, in my case I had a real issue that needed proper handling.

Developer
Posts: 323
Registered: ‎05-07-2009
My Device: BlackBerry Z10, PlayBook, 9900
My Carrier: Telus

Re: Application did not handle 'exit' message and was slayed

The new version is 0.0.6 Bundle 545 (Platform 10.0.6.545)


PlayBook Apps: DataMine, Dots + Boxes, 5 Marbles
BlackBerry SmartPhone Apps: 5 Marbles Soon: **** (D.Z.A), ****Quest, **** Challenge, VaultCracker, DevBrowser, Radial****
Highlighted
Developer
Posts: 49
Registered: ‎06-06-2012
My Device: Bold 9700
My Carrier: Pelephone

Re: Application did not handle 'exit' message and was slayed

I'm back. Apparently I spoke too soon.

 

While the "EUREKA" post above indeed resolved most of this problem for me, I have encountered another scenario, which also yields the "slayed" popup.

 

I have attached a small demo.

 

In this example a WebView embedded in a Sheet seems to be causing the problem. If I don't create the sheet, no error shows at the end. If I do, I get the error. I have tried both explicitly deleting the sheet and not deleting it. Not deleting yields error messages in the Debug Console. Either way though, I get the "slayed" popup at the end.

 

Note that I don't have to actually show the WebView to reproduce this.

 

Any ideas are most welcome.

 

Thanks,

 

Jamie

 

 

Retired
Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: Application did not handle 'exit' message and was slayed

Are you running on 545?

 

Stuart