android - SIGSEGV error with QtThread on deleting QSGNode -
i working on qt app runs on android & ios.
scenario: calling delete on pointer causes app crash gives me following error on android.
fatal signal 11 (sigsegv), code 1, fault addr 0x3c in tid 7134 (qtthread)
this caused due delete call in updatepaintnode
of qquickitem
derived class.
// updatepaintnode logic relevant question qsgnode * myqquickitem::updatepaintnode(qsgnode * oldnode, updatepaintnodedata * updatepaintnodedata) { q_unused(oldnode) q_unused(updatepaintnodedata) if(class_mem_node != q_nullptr) { delete class_mem_node; // crash occurs } class_mem_node = new qsgnode; // execute drawing logic return class_mem_node; }
problem:
window of application dependent on myqquickitem::updatepaintnode
execute on android call delete class_mem_node
causes crash fatal signal
error. interestingly, issue only happens on android, not on ios or osx.
question:
wrong in logic in updatepaintnode
? thread synchronisation issue?
is there way can check whether qsgnode
in use & return out?
when return class_mem_node;
don't have ownership of class_mem_node
more.
the implementation may delete node when becomes not useful. passes nullptr
oldnode
on next call updatepaintnode()
.
don't store class_mem_node
, use oldnode
.
Comments
Post a Comment