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

Trusted Contributor
Posts: 204
Registered: ‎05-15-2012
My Device: None
My Carrier: Telus

NavigationPane, deleting Pages with both QML and C++ Pages

I'm having a hard time deleting Page's from a Navigation page. The issue is that some of the pages I am creating are Page's created with QmlDocuments and some as Pages created with C++.


I'm not sure how to handle this situation, as I can't get a QML or C++ solution working.

QML cannot "see" pages created in C++, so using the QML delete method:

onTriggered: { navigationPane.pop(); }

fails, saying the Page it's trying to delete is indestructible (when deleting either the C++ page or QML page).

Error: "Error: Invalid attempt to destroy() an indestructible object"


Using the C++ SLOT:

QObject::connect(navigationPane, SIGNAL(popTransitionEnded(bb::cascades::Page*)),
        this, SLOT(popFinished(bb::cascades::Page*)));

void popFinished(bb::cascades::Page* page)
    delete page;

fails when deleting the QML page with:

"free malloc object that is not allocated:../../dlist.c:1096",

presumably while it is deleting the QML list on the QML page.

This method does successfully delete the C++ page, however.



Check out my app, Alien Flow for reddit

And of course, like my post if you found it helpful or informative!
Please use plain text.