wxBitmapList::~wxBitmapList ()
{
wxLogDebug("~wxBitmapList: count = %d", Number());
+#ifdef __WXMSW__
wxNode *node = First ();
while (node)
{
wxBitmap *bitmap = (wxBitmap *) node->Data ();
wxNode *next = node->Next ();
- delete bitmap;
-// bitmap->FreeResource(TRUE);
+ if (bitmap->GetVisible())
+ delete bitmap;
node = next;
}
+#endif
}
// Pen and Brush lists
wxPenList::~wxPenList ()
{
+#ifdef __WXMSW__
wxNode *node = First ();
while (node)
{
wxPen *pen = (wxPen *) node->Data ();
wxNode *next = node->Next ();
- delete pen;
-// pen->FreeResource(TRUE);
+ if (pen->GetVisible())
+ delete pen;
node = next;
}
+#endif
}
void wxPenList::AddPen (wxPen * pen)
wxBrushList::~wxBrushList ()
{
+#ifdef __WXMSW__
wxNode *node = First ();
while (node)
{
wxBrush *brush = (wxBrush *) node->Data ();
wxNode *next = node->Next ();
- delete brush;
+ if (brush->GetVisible())
+ delete brush;
node = next;
}
+#endif
}
void wxBrushList::AddBrush (wxBrush * brush)
wxNode *node = First ();
while (node)
{
-/*
+ // Only delete objects that are 'visible', i.e.
+ // that have been created using FindOrCreate...,
+ // where the pointers are expected to be shared
+ // (and therefore not deleted by any one part of an app).
wxFont *font = (wxFont *) node->Data ();
wxNode *next = node->Next ();
- delete font;
- node = next;
-*/
- // New for 2.0: don't delete the font (it may be a member
- // of a wxDC, for example)
- wxFont *font = (wxFont *) node->Data ();
- wxNode *next = node->Next ();
-
- // Force the font to be deleted
- font->FreeResource(TRUE);
+ if (font->GetVisible())
+ delete font;
node = next;
- }
+}
#endif
}
void wxCleanUpResourceSystem(void)
{
delete wxDefaultResourceTable;
+ if (wxResourceBuffer)
+ delete[] wxResourceBuffer;
}
void wxLogWarning(char *msg)
M_BITMAPDATA->m_depth = no_bits ;
M_BITMAPDATA->m_numColors = 0;
- M_BITMAPDATA->m_hBitmap = (WXHBITMAP) CreateBitmap(the_width, the_height, no_bits, 1, bits);
+ M_BITMAPDATA->m_hBitmap = (WXHBITMAP) CreateBitmap(the_width, the_height, 1, no_bits, bits);
if (M_BITMAPDATA->m_hBitmap)
M_BITMAPDATA->m_ok = TRUE;
if (d > 0)
{
- M_BITMAPDATA->m_hBitmap = (WXHBITMAP) CreateBitmap(w, h, d, 1, NULL);
+ M_BITMAPDATA->m_hBitmap = (WXHBITMAP) CreateBitmap(w, h, 1, d, NULL);
}
else
{
long yyy2 = (long) (yyc+ray);
if (m_brush.Ok() && m_brush.GetStyle() !=wxTRANSPARENT)
{
- Pie((HDC) m_hDC,xxx1,yyy1,xxx2,yyy2,
+ // Have to add 1 to bottom-right corner of rectangle
+ // to make semi-circles look right (crooked line otherwise).
+ // Unfortunately this is not a reliable method, depends
+ // on the size of shape.
+ // TODO: figure out why this happens!
+ Pie((HDC) m_hDC,xxx1,yyy1,xxx2+1,yyy2+1,
xx1,yy1,xx2,yy2) ;
}
else