mart added a comment.
In https://phabricator.kde.org/D10250#199624, @davidedmundson wrote: > Good analysis on the plotter. Thanks for looking into it. > > > but in some rare cases, it can be deleted too by some external cause, usually when a widget changes its parent > > If someone deletes something that's meant to be ref-counted it's being used wrong. > If there was a real bug in ManagedTextureNode we would have seen it in all the code that already used it; iconitem, framesvgitem, etc... > > This is just a bug in plotter. If you do need to reverse the smart pointer logic to have a weak pointer, keep it within there. this is since the plotter does access that texture also somewhere else in the code, iconitem etc seems to use it only once.. what i'm suspecting, is that the texture can be deleted by someone else which is not the scoped poiter when the item changes window (by the scene itself perhaps?) so in that case would be a problem that potentially could come up elsewhere as would make the logic of managedtexturenode not completely correct in those edge cases > Btw, you don't need managedtexturenode unless you're using the texturecache, since Qt 5.4 you can use QSGSimpleTextureNode::setOwnsTexture. It might help? I'll try with that REPOSITORY R296 KDeclarative REVISION DETAIL https://phabricator.kde.org/D10250 To: mart, #plasma, davidedmundson Cc: davidedmundson, broulik, ngraham, plasma-devel, #frameworks, michaelh, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart