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
Highlighted
Developer
Posts: 123
Registered: ‎09-18-2013
My Device: Dev Alpha B
My Carrier: BSNL INDIA

Re: WebView freezes and then crashes

connect(appSettings, SIGNAL(triggered()), this, SLOT(displaySettings()));

appMenu = new Menu;
appMenu->setSettingsAction(appSettings);

app->setMenu(appMenu);

 The appSettings is what triggers displaySettings()

 

I have a doubt here. Is there any way that the WebView will load for the first time if there was a memory leak or anything such? I'm new to GUI based programming and please clarify it for me. Also, I have noticed that readonly functions such as isActive() doesn't cause any troubles. Only functions that modify the WebView such as reload() and setUrl() causes the app to crash. What might be wrong?

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

Re: WebView freezes and then crashes

Yes not deleting an object can cause a memory leak and subsequent attempts to access it after the first creation could cause problems in certain circumstances.

 

Have you managed to fix this?


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

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

Re: WebView freezes and then crashes

yes.. i've managed to delete every object using

delete objectName;

 

within the class destructor. Still the error comes up..

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

Re: WebView freezes and then crashes

Note that you don't have to delete objects that have their parent set to another QObject (control) only ones that don't (i.e non derived QObjects or your own classes or those that have not had the parent set or moved).
In fact deleting objects yourself rather than letting the parent do it could also cause an error/crash.

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

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

Re: WebView freezes and then crashes

oops.. i didn't know that.. i'll try to modify my code.. but, i still can't find a reson for the WebView freezing.. U know, the page loads just fine in the Desktop and BB browser..

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

Re: WebView freezes and then crashes

[ Edited ]

If you don't want to post your code, post the webpage link and I will test if it's the webpage itself that is causing the problem.

 

[Edit] LOL. Never mind I'll assume it's the one in the OP.


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

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: WebView freezes and then crashes

[ Edited ]

It's not the page, it works fine in my WebView, even with multiple loads. Smiley Happy

 

So it really is a problem in your code somewhere

 

It will take some time for this to get approved but it's proof that it works...

 

IMG_00000068.png


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

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

Re: WebView freezes and then crashes

that page loads.. there is no problem with that.. the problem actually happens when:

 

1)if u haven't approved the app, the page that appears after you press OK

2)if already approved, the page that appears after login

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

Re: WebView freezes and then crashes

Okay, well I don't really want to go past that page. Smiley Happy

 

Try this code and see if it works on it's own...

 

Page {
    Container {
        WebView {
           verticalAlignment: VerticalAlignment.Center
           horizontalAlignment: HorizontalAlignment.Center
           preferredHeight: 900
           preferredWidth: 700

            url: "http://connectapp.3owl.com"

    }
}

 

 

At least then you'll be able to rule out whether it's the WebView.


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

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

Re: WebView freezes and then crashes

well, it doesn't work as well.. simply freezes past the login page(app already verified) and then, crashes.. do you think it's some kind of bug..??