|
|
Home » U++ Library support » TopWindow&PopUp, TrayIcon » TopWindow when Close override show exception unduly
TopWindow when Close override show exception unduly [message #56181] |
Thu, 04 February 2021 15:51  |
BetoValle
Messages: 204 Registered: September 2020 Location: Brasil Valinhos SP
|
Experienced Member |
|
|
Hi,
when I create a simple application as shown below and rewrite the close method, when executing the application
memory exception is reported
(under windows 10 / 64bits /memory 8GB / TheIDE 15040 / memory free 42%)
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
class SMain : public TopWindow {
public:
typedef SMain CLASSNAME;
SMain();
void Close() override {
delete this; // error show heap is corrupted !!!!
}
};
SMain::SMain()
{
}
GUI_APP_MAIN
{
SMain se;
se.Run();
}
in the log file
Heap is corrupted --memory-breakpoint__ 3197158753
Memory at 0x000000000171FBF0, size 0x1 = 1
+0 0x000000000171FBF0 08 .
****************** PANIC: Heap is corrupted --memory-breakpoint__ 3197158753
If I don't rewrite the method to close, there is no exception. This means a bug!
Important: I also noticed that if you add a layout containing a menu also with an option to close
the screen pointed to the same method, the exception will no longer occur. Perhaps this is why this
issue has not yet become evident.
thanks
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Fri May 09 15:58:46 CEST 2025
Total time taken to generate the page: 0.00604 seconds
|
|
|