EVT_CHOICE(-1, wxComboBoxChoice::OnChoice)
END_EVENT_TABLE()
-
-
-
wxComboBox::~wxComboBox()
{
- // delete the controls now, don't leave them alive even though they woudl
+ // delete the controls now, don't leave them alive even though they would
// still be eventually deleted by our parent - but it will be too late, the
// user code expects them to be gone now
- delete m_text;
- delete m_choice;
+ if (m_text != NULL) {
+ delete m_text;
+ m_text = NULL;
+ }
+ if (m_choice != NULL) {
+ delete m_choice;
+ m_choice = NULL;
+ }
}
wxDir::~wxDir()
{
- delete M_DIR;
+ if (M_DIR != NULL) {
+ delete M_DIR;
+ m_data = NULL;
+ }
}
// ----------------------------------------------------------------------------
wxGLCanvas::~wxGLCanvas()
{
- if (m_glContext)
- delete m_glContext;
+ if (m_glContext != NULL) {
+ delete m_glContext;
+ m_glContext = NULL;
+ }
}
static AGLPixelFormat ChoosePixelFormat(const int *attribList)
size_t uiCount = m_aItems.Count();
while ( uiCount-- != 0 ) {
delete m_aItems[uiCount];
+ m_aItems[uiCount] = NULL;
}
m_aItems.Clear();
size_t ui = m_aItems.Count();
while ( ui-- != 0 ) {
delete m_aItems[ui];
+ m_aItems[ui] = NULL;
}
m_aItems.Empty();
wxPaletteRefData::~wxPaletteRefData()
{
- delete[] m_palette ;
+ if (m_palette != NULL) {
+ delete[] m_palette ;
+ m_palette = NULL;
+ }
}
wxPalette::wxPalette()
Width = width; Height = height; Depth = depth;
ColorType = (colortype>=0) ? colortype: ((Depth>8) ? COLORTYPE_COLOR: 0);
delete m_palette;
- delete[] RawImage ;
- RawImage = 0;
- m_palette = 0;
+ m_palette = NULL;
+ delete[] RawImage;
+ RawImage = NULL;
- if (lpbi)
- {
+ if (lpbi) {
wxMacDestroyGWorld( (GWorldPtr) lpbi ) ;
}
lpbi = wxMacCreateGWorld( Width , Height , Depth);
wxPNGReader::~wxPNGReader ( )
{
- delete[] RawImage ;
- if (lpbi) {
+ if (RawImage != NULL) {
+ delete[] RawImage ;
+ RawImage = NULL;
+ }
+ if (lpbi) {
wxMacDestroyGWorld( (GWorldPtr) lpbi ) ;
- }
- delete m_palette;
+ lpbi = NULL;
+ }
+ if (m_palette != NULL) {
+ delete m_palette;
+ m_palette = NULL;
+ }
}
{
if (lpbi) {
wxMacDestroyGWorld( (GWorldPtr) lpbi ) ;
+ lpbi = NULL;
+ }
+ if (m_palette != NULL) {
+ delete m_palette;
+ m_palette = NULL;
}
- delete m_palette;
- lpbi = NULL;
- m_palette = NULL;
}
wxBitmap* wxPNGReader::GetBitmap(void)
if (!info_ptr)
{
fclose(fp);
- delete(png_ptr);
+ delete png_ptr;
return FALSE;
}
/* set error handling */
{
png_read_destroy(png_ptr, info_ptr, (png_info *)0);
fclose(fp);
- delete(png_ptr);
- delete(info_ptr);
+ delete png_ptr;
+ delete info_ptr;
/* If we get here, we had a problem reading the file */
return FALSE;
png_read_destroy(png_ptr, info_ptr, (png_info *)0);
/* free the structures */
- delete(png_ptr);
- delete(info_ptr);
+ delete png_ptr;
+ delete info_ptr;
/* close the file */
fclose(fp);
if (!info_ptr)
{
fclose(fp);
- delete(png_ptr);
+ delete png_ptr;
return FALSE;
}
{
png_write_destroy(png_ptr);
fclose(fp);
- delete(png_ptr);
- delete(info_ptr);
+ delete png_ptr;
+ delete info_ptr;
/* If we get here, we had a problem reading the file */
return FALSE;
delete[] (info_ptr->palette);
/* free the structures */
- delete(png_ptr);
- delete(info_ptr);
+ delete png_ptr;
+ delete info_ptr;
/* close the file */
fclose(fp);
wxPrintDialog::~wxPrintDialog()
{
- if (m_destroyDC && m_printerDC)
+ if (m_destroyDC && m_printerDC) {
delete m_printerDC;
+ m_printerDC = NULL;
+ }
}
int wxPrintDialog::ShowModal()
{
if ( m_locked > 0 )
{
- wxLogDebug(_T("Warning: freeing a locked mutex (%d locks)."), m_locked);
+ wxLogDebug(_T("Warning: freeing a locked mutex (%ld locks)."), m_locked);
}
}
wxThread::~wxThread()
{
s_threads.Remove( (void*) this ) ;
- delete m_internal;
+ if (m_internal != NULL) {
+ delete m_internal;
+ m_internal = NULL;
+ }
}
// create/start thread
wxTimer::~wxTimer()
{
Stop();
- delete m_info ;
- m_info = NULL ;
+ if (m_info != NULL) {
+ delete m_info ;
+ m_info = NULL ;
+ }
int index = gTimersInProcess.Index( this ) ;
if ( index != wxNOT_FOUND )
gTimersInProcess.RemoveAt( index ) ;
wxMacToolTip::~wxMacToolTip()
{
- if ( m_timer )
+ if ( m_timer ) {
delete m_timer ;
- if ( m_backpict )
- Clear() ;
+ m_timer = NULL;
+ }
+ if ( m_backpict )
+ Clear() ;
}
const short kTipBorder = 2 ;
EVT_CHOICE(-1, wxComboBoxChoice::OnChoice)
END_EVENT_TABLE()
-
-
-
wxComboBox::~wxComboBox()
{
- // delete the controls now, don't leave them alive even though they woudl
+ // delete the controls now, don't leave them alive even though they would
// still be eventually deleted by our parent - but it will be too late, the
// user code expects them to be gone now
- delete m_text;
- delete m_choice;
+ if (m_text != NULL) {
+ delete m_text;
+ m_text = NULL;
+ }
+ if (m_choice != NULL) {
+ delete m_choice;
+ m_choice = NULL;
+ }
}
wxDir::~wxDir()
{
- delete M_DIR;
+ if (M_DIR != NULL) {
+ delete M_DIR;
+ m_data = NULL;
+ }
}
// ----------------------------------------------------------------------------
wxGLCanvas::~wxGLCanvas()
{
- if (m_glContext)
- delete m_glContext;
+ if (m_glContext != NULL) {
+ delete m_glContext;
+ m_glContext = NULL;
+ }
}
static AGLPixelFormat ChoosePixelFormat(const int *attribList)
size_t uiCount = m_aItems.Count();
while ( uiCount-- != 0 ) {
delete m_aItems[uiCount];
+ m_aItems[uiCount] = NULL;
}
m_aItems.Clear();
size_t ui = m_aItems.Count();
while ( ui-- != 0 ) {
delete m_aItems[ui];
+ m_aItems[ui] = NULL;
}
m_aItems.Empty();
wxPaletteRefData::~wxPaletteRefData()
{
- delete[] m_palette ;
+ if (m_palette != NULL) {
+ delete[] m_palette ;
+ m_palette = NULL;
+ }
}
wxPalette::wxPalette()
Width = width; Height = height; Depth = depth;
ColorType = (colortype>=0) ? colortype: ((Depth>8) ? COLORTYPE_COLOR: 0);
delete m_palette;
- delete[] RawImage ;
- RawImage = 0;
- m_palette = 0;
+ m_palette = NULL;
+ delete[] RawImage;
+ RawImage = NULL;
- if (lpbi)
- {
+ if (lpbi) {
wxMacDestroyGWorld( (GWorldPtr) lpbi ) ;
}
lpbi = wxMacCreateGWorld( Width , Height , Depth);
wxPNGReader::~wxPNGReader ( )
{
- delete[] RawImage ;
- if (lpbi) {
+ if (RawImage != NULL) {
+ delete[] RawImage ;
+ RawImage = NULL;
+ }
+ if (lpbi) {
wxMacDestroyGWorld( (GWorldPtr) lpbi ) ;
- }
- delete m_palette;
+ lpbi = NULL;
+ }
+ if (m_palette != NULL) {
+ delete m_palette;
+ m_palette = NULL;
+ }
}
{
if (lpbi) {
wxMacDestroyGWorld( (GWorldPtr) lpbi ) ;
+ lpbi = NULL;
+ }
+ if (m_palette != NULL) {
+ delete m_palette;
+ m_palette = NULL;
}
- delete m_palette;
- lpbi = NULL;
- m_palette = NULL;
}
wxBitmap* wxPNGReader::GetBitmap(void)
if (!info_ptr)
{
fclose(fp);
- delete(png_ptr);
+ delete png_ptr;
return FALSE;
}
/* set error handling */
{
png_read_destroy(png_ptr, info_ptr, (png_info *)0);
fclose(fp);
- delete(png_ptr);
- delete(info_ptr);
+ delete png_ptr;
+ delete info_ptr;
/* If we get here, we had a problem reading the file */
return FALSE;
png_read_destroy(png_ptr, info_ptr, (png_info *)0);
/* free the structures */
- delete(png_ptr);
- delete(info_ptr);
+ delete png_ptr;
+ delete info_ptr;
/* close the file */
fclose(fp);
if (!info_ptr)
{
fclose(fp);
- delete(png_ptr);
+ delete png_ptr;
return FALSE;
}
{
png_write_destroy(png_ptr);
fclose(fp);
- delete(png_ptr);
- delete(info_ptr);
+ delete png_ptr;
+ delete info_ptr;
/* If we get here, we had a problem reading the file */
return FALSE;
delete[] (info_ptr->palette);
/* free the structures */
- delete(png_ptr);
- delete(info_ptr);
+ delete png_ptr;
+ delete info_ptr;
/* close the file */
fclose(fp);
wxPrintDialog::~wxPrintDialog()
{
- if (m_destroyDC && m_printerDC)
+ if (m_destroyDC && m_printerDC) {
delete m_printerDC;
+ m_printerDC = NULL;
+ }
}
int wxPrintDialog::ShowModal()
{
if ( m_locked > 0 )
{
- wxLogDebug(_T("Warning: freeing a locked mutex (%d locks)."), m_locked);
+ wxLogDebug(_T("Warning: freeing a locked mutex (%ld locks)."), m_locked);
}
}
wxThread::~wxThread()
{
s_threads.Remove( (void*) this ) ;
- delete m_internal;
+ if (m_internal != NULL) {
+ delete m_internal;
+ m_internal = NULL;
+ }
}
// create/start thread
wxTimer::~wxTimer()
{
Stop();
- delete m_info ;
- m_info = NULL ;
+ if (m_info != NULL) {
+ delete m_info ;
+ m_info = NULL ;
+ }
int index = gTimersInProcess.Index( this ) ;
if ( index != wxNOT_FOUND )
gTimersInProcess.RemoveAt( index ) ;
wxMacToolTip::~wxMacToolTip()
{
- if ( m_timer )
+ if ( m_timer ) {
delete m_timer ;
- if ( m_backpict )
- Clear() ;
+ m_timer = NULL;
+ }
+ if ( m_backpict )
+ Clear() ;
}
const short kTipBorder = 2 ;