From 8ae981dec8493a4cc0c457c50e55e64d064b7294 Mon Sep 17 00:00:00 2001 From: lcgamboa Date: Sun, 4 Feb 2024 13:57:40 -0300 Subject: [PATCH] chg: Code refactor - Fix Windows freezing !minor --- VERSION | 2 +- src/picsimlab1.cc | 2 +- src/picsimlab5.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index 1001deb1..625fd3fc 100644 --- a/VERSION +++ b/VERSION @@ -2,5 +2,5 @@ PACKAGE=picsimlab MAINVER=0 MINORVER=9 VERSION=0.9.1 -DATE=240201 +DATE=240204 VERSION_STABLE=0.9.1 diff --git a/src/picsimlab1.cc b/src/picsimlab1.cc index a6c477ba..650a6d0d 100644 --- a/src/picsimlab1.cc +++ b/src/picsimlab1.cc @@ -2148,8 +2148,8 @@ int CPWindow1::OnExtraWindowCmd(const int id, const char* ControlName, const PIC case PWA_WINDOWDESTROY: ((CPWindow*)ctrl)->Hide(); ((CPWindow*)ctrl)->DestroyChilds(); + ((CPWindow*)ctrl)->SetCanDestroy(true); ((CPWindow*)ctrl)->WDestroy(); - delete ctrl; ctrl = NULL; break; case PWA_WINDOWLOADXML: diff --git a/src/picsimlab5.cc b/src/picsimlab5.cc index 67d39ef9..761ff857 100644 --- a/src/picsimlab5.cc +++ b/src/picsimlab5.cc @@ -1271,8 +1271,8 @@ int CPWindow5::OnExtraWindowCmd(const int id, const char* ControlName, const PIC case PWA_WINDOWDESTROY: ((CPWindow*)ctrl)->Hide(); ((CPWindow*)ctrl)->DestroyChilds(); + ((CPWindow*)ctrl)->SetCanDestroy(true); ((CPWindow*)ctrl)->WDestroy(); - delete ctrl; ctrl = NULL; break; case PWA_WINDOWLOADXML: