Making sure Verification Objects are deleted properly

This commit is contained in:
Chethan2k1 2020-09-10 13:25:49 +05:30
parent e70b4e4268
commit a27662dc08
3 changed files with 19 additions and 14 deletions

View file

@ -82,9 +82,9 @@ ApplicationWindow {
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
} }
onClicked: { onClicked: {
dialog.close();
deviceVerificationList.remove(tran_id); deviceVerificationList.remove(tran_id);
delete flow; flow.deleteFlow();
dialog.destroy();
} }
} }
Item { Item {
@ -141,9 +141,9 @@ ApplicationWindow {
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
} }
onClicked: { onClicked: {
dialog.close();
flow.cancelVerification(DeviceVerificationFlow.User); flow.cancelVerification(DeviceVerificationFlow.User);
deviceVerificationList.remove(tran_id); deviceVerificationList.remove(tran_id);
dialog.destroy();
} }
} }
Item { Item {
@ -205,9 +205,9 @@ ApplicationWindow {
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
} }
onClicked: { onClicked: {
dialog.close();
flow.cancelVerification(DeviceVerificationFlow.User); flow.cancelVerification(DeviceVerificationFlow.User);
deviceVerificationList.remove(tran_id); deviceVerificationList.remove(tran_id);
dialog.destroy();
} }
} }
Item { Item {
@ -267,9 +267,9 @@ ApplicationWindow {
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
} }
onClicked: { onClicked: {
dialog.close();
flow.cancelVerification(DeviceVerificationFlow.MismatchedSAS); flow.cancelVerification(DeviceVerificationFlow.MismatchedSAS);
deviceVerificationList.remove(tran_id); deviceVerificationList.remove(tran_id);
dialog.destroy();
} }
} }
Item { Item {
@ -426,9 +426,9 @@ ApplicationWindow {
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
} }
onClicked: { onClicked: {
dialog.close();
flow.cancelVerification(DeviceVerificationFlow.MismatchedSAS); flow.cancelVerification(DeviceVerificationFlow.MismatchedSAS);
deviceVerificationList.remove(tran_id); deviceVerificationList.remove(tran_id);
dialog.destroy();
} }
} }
Item { Item {
@ -487,9 +487,9 @@ ApplicationWindow {
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
} }
onClicked: { onClicked: {
dialog.close();
flow.cancelVerification(DeviceVerificationFlow.User); flow.cancelVerification(DeviceVerificationFlow.User);
deviceVerificationList.remove(tran_id); deviceVerificationList.remove(tran_id);
dialog.destroy();
} }
} }
Item { Item {
@ -534,9 +534,9 @@ ApplicationWindow {
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
} }
onClicked: { onClicked: {
dialog.close()
deviceVerificationList.remove(tran_id); deviceVerificationList.remove(tran_id);
delete flow; flow.deleteFlow();
dialog.destroy();
} }
} }
} }
@ -578,8 +578,8 @@ ApplicationWindow {
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
} }
onClicked: { onClicked: {
dialog.close();
deviceVerificationList.remove(tran_id); deviceVerificationList.remove(tran_id);
dialog.destroy();
} }
} }
} }
@ -622,9 +622,9 @@ ApplicationWindow {
} }
text: qsTr("Close") text: qsTr("Close")
onClicked: { onClicked: {
dialog.close()
deviceVerificationList.remove(tran_id); deviceVerificationList.remove(tran_id);
delete flow; flow.deleteFlow();
dialog.destroy()
} }
} }
} }

View file

@ -41,6 +41,10 @@ DeviceVerificationFlow::DeviceVerificationFlow(QObject *,
this->deleteLater(); this->deleteLater();
}); });
connect(this,&DeviceVerificationFlow::deleteFlow,this,[this](){
this->deleteLater();
});
connect( connect(
ChatPage::instance(), ChatPage::instance(),
&ChatPage::recievedDeviceVerificationStart, &ChatPage::recievedDeviceVerificationStart,

View file

@ -105,6 +105,7 @@ signals:
void timedout(); void timedout();
void verificationCanceled(); void verificationCanceled();
void refreshProfile(); void refreshProfile();
void deleteFlow();
private: private:
// general // general