c++ - Will the connection be disconnected in Qt automatically? -


from problem here: qt signals , slots object disconnect? if first call delete on qobject, call disconnect function this:

myqclass* = new myqclass(); connect(a,signal(a_s()),this,slot(b_s())); a->deletelater(); ... disconnect(a,signal(a_s()),this,slot(b_s())); 

will cause crash? found cause crash under qt4, not qt5? different qt version doing different? otherwise, there might else wrong code.

connections disconnected automatically on object destruction. crash happens because trying call disconnect on object destroyed. getting dangling pointer (having address object not exist anymore). depends little "..." is.


Comments

Popular posts from this blog

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -