Skip to content

Commit

Permalink
fixed small memory leak and unnessary debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
aardappel committed Oct 16, 2014
1 parent e067eea commit 2cca487
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/document.h
Expand Up @@ -215,7 +215,8 @@ struct Document

sys->FileUsed(filename, this);

::wxRemoveFile(sys->TmpName(filename));
if(::wxFileExists(sys->TmpName(filename)))
::wxRemoveFile(sys->TmpName(filename));
}

UpdateFileName(page);
Expand Down Expand Up @@ -715,7 +716,7 @@ struct Document
bool CloseDocument()
{
bool keep = CheckForChanges();
if(!keep && !filename.empty()) ::wxRemoveFile(sys->TmpName(filename));
if(!keep && !filename.empty() && ::wxFileExists(sys->TmpName(filename))) ::wxRemoveFile(sys->TmpName(filename));
return keep;
}

Expand Down
5 changes: 4 additions & 1 deletion src/myframe.h
Expand Up @@ -601,6 +601,9 @@ struct MyFrame : wxFrame
aui->UnInit();
DELETEP(aui);
DELETEP(editmenupopup);
#ifdef FSWATCH
DELETEP(watcher);
#endif
}
/*
void OnSize(wxSizeEvent& event)
Expand Down Expand Up @@ -819,7 +822,7 @@ struct MyFrame : wxFrame
void OnSizing(wxSizeEvent &se) { se.Skip(); }

void OnMaximize(wxMaximizeEvent &me) { ReFocus(); me.Skip(); }
void OnActivate(wxActivateEvent &ae) { ReFocus(); }
void OnActivate(wxActivateEvent &ae) { /*ReFocus();*/ }

void OnIconize(wxIconizeEvent &me)
{
Expand Down

0 comments on commit 2cca487

Please sign in to comment.