Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous message
BetoValle is currently offline  BetoValle
Messages: 203
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



 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to remove the button [X] that closes the window?
Next Topic: same layout with different dimensions
Goto Forum:
  


Current Time: Thu Apr 25 03:30:15 CEST 2024

Total time taken to generate the page: 0.31766 seconds