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: 207
Registered: ‎02-10-2011
My Device: Playbook 16GB and Z10
My Carrier: Verizon
Accepted Solution

metaCall SIGSEGV

[ Edited ]

I am making a music player app, and I have run into an interesting issue.

On my Currently Playing page I have QML like this:

 

Label {
         id: songTitle
         //text: "Song Title"
         text: _app.currSong.song.title
         textStyle {
              base: SystemDefaults.TextStyles.BigText
              color: Color.White
         }
}

 And in my C++ .h I have this:

 

Q_PROPERTY(QVariantMap song READ song NOTIFY textChanged)

 So when I push my currently playing page on after its been created everything works fine, going to the next song and backwards the label gets updated approprately to the currsong map.

But if I navigate back, on a pop transition I do a playPage.destroy() because one of the sample apps said something about there being a possible memory leak if I didn't.

But when I navigate back to my list of songs, select a new song, when that song emit's textChanged() I get a:

 

Segmentation fault: QMetaObject::metaCall()

 

After some research I came across this bug in Qt: Recently reported Qt bug

 

I am assuming its because when I first created the PlayPage it binds that label's text to _app.currSong.song.title, then when that page is destroyed, that field no longer exists yet it's binding still does.

 

Can anyone shed some light on what really might be happening?

 

Note: I removed the playPage.destroy() but because the Quotes sample code says if I don't do that there will be a memory leak I hate for that to be the solution.

_________________________________________________
Apps
Go Music
Flashlight Fast Free/Pro
Fitbit for BlackBerry PlayBook
Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: metaCall SIGSEGV

[ Edited ]

There is similar problem with signals which were manually binded inside of QML. They aren't disconnected on destroy.

 

Could you try calling

currentlyPlayingPage.songTitle.text = null

before destroying the page?

This should unbind it.

 

For consistency all signal-disconnecting code can be placed into a single function in every component, so destroy would look like this:

currentPage.disconnectSignals()

currentPage.destroy()

 


Andrey Fidrya, @zmeyc on twitter
Developer
Posts: 207
Registered: ‎02-10-2011
My Device: Playbook 16GB and Z10
My Carrier: Verizon

Re: metaCall SIGSEGV

[ Edited ]

This works perfectly! Thank you!

 

Edit: if you use Google Music, I will give you a free copy of my app Smiley Happy

_________________________________________________
Apps
Go Music
Flashlight Fast Free/Pro
Fitbit for BlackBerry PlayBook