patch from Dimitri fixing a few memory leaks and unTABbing the sources

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14660 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2002-03-17 14:16:03 +00:00
parent 1c9f1f4d51
commit 2f6c54eb07
62 changed files with 616 additions and 552 deletions

View File

@@ -6,7 +6,7 @@
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
// Licence: wxWindows license
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
@@ -87,6 +87,16 @@ MyFrame::MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos, cons
canvas = (MyCanvas *) NULL;
}
// frame destructor
MyFrame::~MyFrame()
{
if (g_TestBitmap)
{
delete g_TestBitmap;
g_TestBitmap = (wxBitmap *) NULL;
}
}
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{
Close(TRUE);
@@ -128,16 +138,17 @@ void MyFrame::OnSaveFile(wxCommandEvent& WXUNUSED(event))
void MyFrame::OnLoadFile(wxCommandEvent& WXUNUSED(event))
{
// Show file selector.
wxString f = wxFileSelector(wxT("Open Image"), (const wxChar *) NULL,
// Show file selector.
wxString f = wxFileSelector(wxT("Open Image"), (const wxChar *) NULL,
(const wxChar *) NULL, wxT("png"),
wxT("PNG files (*.png)|*.png"));
if (f == "")
return;
if (f == "")
return;
if ( g_TestBitmap )
delete g_TestBitmap;
g_TestBitmap = new wxBitmap(f, wxBITMAP_TYPE_PNG);
if (!g_TestBitmap->Ok())
{