Weird crash of QNetworkAccessManager::post()
-
@MemphisWang said in Weird crash of QNetworkAccessManager::post():
can i continue to use this pointer immediately
Yes, you can even use the same object immediately.
this->pObj = new Foo(); this->pObj->doingSomeThing(); this->pObj->deleteLater(); this->pObj->someOtherThing(); //< Valid until you return control to the event loop
@kshegunov that's nice, and convenient. I can be less careful about memory and care more about business logic.
-
@kshegunov that's nice, and convenient. I can be less careful about memory and care more about business logic.
Well, it's "invented" not to make you less careful about memory, but exactly because
delete
ing an object that's referenced in a queued event in the event loop is pretty nasty - I'd segfault.