Memory leaks on errorneous exit fixed
This commit is contained in:
parent
14faad593f
commit
b325e0a061
@ -12,6 +12,8 @@ ______________________________________________________________________
|
|||||||
Notes for GoldED+ 1.1.5, /snapshot/
|
Notes for GoldED+ 1.1.5, /snapshot/
|
||||||
______________________________________________________________________
|
______________________________________________________________________
|
||||||
|
|
||||||
|
- Thanks to Pavel Tsekov few more memory leaks was eliminated.
|
||||||
|
|
||||||
! Added "COLOR READER URL" for highlighting URLs and e-mail's.
|
! Added "COLOR READER URL" for highlighting URLs and e-mail's.
|
||||||
|
|
||||||
! Message now saved by default in local codepage.
|
! Message now saved by default in local codepage.
|
||||||
|
@ -1062,6 +1062,9 @@ Area::Area(gmo_area* a) {
|
|||||||
|
|
||||||
Area::~Area() {
|
Area::~Area() {
|
||||||
|
|
||||||
|
if(isopen())
|
||||||
|
Close();
|
||||||
|
|
||||||
throw_delete(area);
|
throw_delete(area);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,6 +37,8 @@
|
|||||||
|
|
||||||
extern GPickArealist* PickArealist;
|
extern GPickArealist* PickArealist;
|
||||||
extern bool in_arealist;
|
extern bool in_arealist;
|
||||||
|
extern uint* areanumbers;
|
||||||
|
extern GMsg* reader_msg;
|
||||||
|
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
// Clean up the screen, memory and files before exiting to DOS
|
// Clean up the screen, memory and files before exiting to DOS
|
||||||
@ -48,6 +50,14 @@ void Cleanup(void) {
|
|||||||
if(CFG->switches.get(areakeeplast) and startupscan_success)
|
if(CFG->switches.get(areakeeplast) and startupscan_success)
|
||||||
AL.WriteGoldLast();
|
AL.WriteGoldLast();
|
||||||
|
|
||||||
|
// Free msg data
|
||||||
|
if (reader_msg != NULL) {
|
||||||
|
ResetMsg(reader_msg);
|
||||||
|
throw_release(reader_msg);
|
||||||
|
}
|
||||||
|
// Free area data
|
||||||
|
AL.Reset();
|
||||||
|
|
||||||
#ifndef GMB_NOXBBS
|
#ifndef GMB_NOXBBS
|
||||||
if(AL.msgbases & MT_ADEPTXBBS)
|
if(AL.msgbases & MT_ADEPTXBBS)
|
||||||
XbbsExit();
|
XbbsExit();
|
||||||
@ -89,9 +99,6 @@ void Cleanup(void) {
|
|||||||
|
|
||||||
SearchExit();
|
SearchExit();
|
||||||
|
|
||||||
// Free area data
|
|
||||||
AL.Reset();
|
|
||||||
|
|
||||||
// Free various lists
|
// Free various lists
|
||||||
CFG->addressmacro.clear();
|
CFG->addressmacro.clear();
|
||||||
CFG->aka.clear();
|
CFG->aka.clear();
|
||||||
@ -136,8 +143,10 @@ void Cleanup(void) {
|
|||||||
gvid->setoverscan(gvid->orig.color.overscan);
|
gvid->setoverscan(gvid->orig.color.overscan);
|
||||||
|
|
||||||
wcloseall(); // Close all windows
|
wcloseall(); // Close all windows
|
||||||
if(in_arealist)
|
if(in_arealist) {
|
||||||
PickArealist->close_all(); // Unlink hidden area windows
|
PickArealist->close_all(); // Unlink hidden area windows
|
||||||
|
throw_release(areanumbers);
|
||||||
|
}
|
||||||
whelpundef(); // Disengage the help system
|
whelpundef(); // Disengage the help system
|
||||||
kbclear(); // Clear CXL keyboard buffer
|
kbclear(); // Clear CXL keyboard buffer
|
||||||
freonkey(); // Free all onkeys (macros)
|
freonkey(); // Free all onkeys (macros)
|
||||||
|
@ -795,6 +795,8 @@ void Reader() {
|
|||||||
|
|
||||||
ResetMsg(msg);
|
ResetMsg(msg);
|
||||||
throw_free(msg);
|
throw_free(msg);
|
||||||
|
// Invalidate reader_msg since the actual data has just been freed.
|
||||||
|
reader_msg = NULL;
|
||||||
|
|
||||||
HandleGEvent(EVTT_EXIT);
|
HandleGEvent(EVTT_EXIT);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user