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
Post a Comment