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
Contributor
developerUK
Posts: 35
Registered: ‎11-21-2012
My Device: 9810
My Carrier: o2

app draining battery after exit

I have a problem where if i run my app on the dev alpha device and then exit the app the battery is draining after a couple of hours and the device is warm as if it is doing work but when i look at target navigator view i see that the process for my app is not there (as a running process) after I exit.

 

The app involves socket connections and some qt controls.

 

Is it possible I maybe doing something incorrect to cause the battery to drain - what should I be looking out for? I am new to native development coming from java and I obviously dont want complaints from users.

 

Thanks for any advice you can offer me.

Please use plain text.
Developer
lewellyn
Posts: 110
Registered: ‎10-22-2011
My Device: PlayBook, Bold 9650, Dev Alpha A
My Carrier: Sprint

Re: app draining battery after exit

If your app is not running, it is unlikely to be at fault.

Do you see this with samples from Github, or just your own app? If it is just your own app, you should try to create a minimal example which causes the behavior and file it on the developer issue tracker. It would not be a terrible idea to link the issue in this thread, if you file one. :smileyhappy:


Is there a helpful or useful post in this thread? Click the thumbs up on it so that other people can find it more easily!
Like this post too! :smileyvery-happy:
Please use plain text.
Contributor
developerUK
Posts: 35
Registered: ‎11-21-2012
My Device: 9810
My Carrier: o2

Re: app draining battery after exit

I will look more into it and see if it is worth doing as you say with issue tracker. 

 

Unfortunatley it does seem to happen only when one of my/any apps has been accessed and then closed. 

 

Thanks.

Please use plain text.
Contributor
developerUK
Posts: 35
Registered: ‎11-21-2012
My Device: 9810
My Carrier: o2

Re: app draining battery after exit

I have found what potentially could be the cause for the draining of the battery after exiting the app. I have noticed a sigsegv error when exiting the app (I have not exited the app using the window exit icon for a while). The app uses qt libraries for it's ui. I have made code the same as many samples (int main creates a QMainWindow, show it, exec, delete window, return). The sigsegv is being triggered after all code has been run in int main() so im stuck as to what might be causing this sigsegv error. What could cause sigsegv error after all code in app has been executed and returned from main and what can i do to solve. Thanks for anything you can offer.
Please use plain text.
Developer
lewellyn
Posts: 110
Registered: ‎10-22-2011
My Device: PlayBook, Bold 9650, Dev Alpha A
My Carrier: Sprint

Re: app draining battery after exit

Once your app quits (whether normally or abnormally), it really isn't your responsibility anymore. :robotwink:

 

You should build a very minimal test case, file it on the Developer Issue Tracker, ask them to make it public, and post the link here. That will help us in the community try to avoid the issue, perhaps help you work around it, and allow us to show RIM support for getting the core problem fixed. :robotvery-happy:



Is there a helpful or useful post in this thread? Click the thumbs up on it so that other people can find it more easily!
Like this post too! :smileyvery-happy:
Please use plain text.
Contributor
developerUK
Posts: 35
Registered: ‎11-21-2012
My Device: 9810
My Carrier: o2

Re: app draining battery after exit

Thanks for your reply,

 

I just don't think I should be seeing a sigsegv error when closing the app whilst its debugging as I don't see an error when closing another one of my apps whilst debugging. So it means it's not exiting gracefully.

 

It's also strange that the sigsegv occurs after all my code is executed and I can't understand why.

 

 

Please use plain text.
Developer
lewellyn
Posts: 110
Registered: ‎10-22-2011
My Device: PlayBook, Bold 9650, Dev Alpha A
My Carrier: Sprint

Re: app draining battery after exit

There are a great many things it could be. Narrowing it down to a very minimal test case is helpful to both you and those trying to assist you. :smileyhappy:

It also allows you to protect your "real" app from the prying eyes of the forum. :smileywink:


Is there a helpful or useful post in this thread? Click the thumbs up on it so that other people can find it more easily!
Like this post too! :smileyvery-happy:
Please use plain text.
Contributor
developerUK
Posts: 35
Registered: ‎11-21-2012
My Device: 9810
My Carrier: o2

Re: app draining battery after exit

I have just found QBBWindow: failed to set window z-order=2, errno=22, mWindow=0x08186280 at the end of the console output (after last line of code has been executed in int main) which I haven't seen before.

 

What does this mean?

 

I am using ndk 10, QtGui and QtCore and I also mix a native screen with a QMainWindow for the purposes of the application.

 

Hopefully now I can see the cause of the segmentation fault.

Please use plain text.
Developer
BGmot
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook
My Carrier: x

Re: app draining battery after exit

> (int main creates a QMainWindow, show it, exec, delete window, return)

What do you mean by delete window?

Please use plain text.