]> git.saurik.com Git - wxWidgets.git/blobdiff - demos/forty/card.cpp
fix memory leak as Dimitri suggested
[wxWidgets.git] / demos / forty / card.cpp
index 8c3df09b0c313a7950442b82dc1b47c9d541fa94..94df4387328be7ae4de57d507c7ba7f7b0adb5c6 100644 (file)
@@ -41,7 +41,7 @@
 #include "forty.h"
 #include "card.h"
 
-#if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__)
+#if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXX11__)
 #include "pictures.xpm"
 #include "symbols.xbm"
 #endif
@@ -67,25 +67,25 @@ Card::Card(int value, WayUp way_up) :
        if (!m_symbolBmap)
        {
 #ifdef __WXMSW__
-               m_symbolBmap = new wxBitmap("CardSymbols", wxBITMAP_TYPE_BMP_RESOURCE);
+               m_symbolBmap = new wxBitmap(_T("CardSymbols"), wxBITMAP_TYPE_BMP_RESOURCE);
 #else
                m_symbolBmap = new wxBitmap(Symbols_bits, Symbols_width, Symbols_height);
 #endif
                if (!m_symbolBmap->Ok())
                {
-                       ::wxMessageBox("Failed to load bitmap CardSymbols", "Error");
+                       ::wxMessageBox(_T("Failed to load bitmap CardSymbols"), _T("Error"));
                }
        }
        if (!m_pictureBmap)
        {
 #ifdef __WXMSW__
-               m_pictureBmap = new wxBitmap("CardPictures", wxBITMAP_TYPE_BMP_RESOURCE);
+               m_pictureBmap = new wxBitmap(_T("CardPictures"), wxBITMAP_TYPE_BMP_RESOURCE);
 #else
                m_pictureBmap = new wxBitmap(Pictures);
 #endif
                if (!m_pictureBmap->Ok())
                {
-                       ::wxMessageBox("Failed to load bitmap CardPictures", "Error");
+                       ::wxMessageBox(_T("Failed to load bitmap CardPictures"), _T("Error"));
                }
        }
 
@@ -196,7 +196,7 @@ void Card::Draw(wxDC& dc, int x, int y)
                dc.SetBackground(* wxRED_BRUSH);
                dc.SetBackgroundMode(wxSOLID);
                wxBrush* brush = wxTheBrushList->FindOrCreateBrush(
-                                                       "BLACK", wxCROSSDIAG_HATCH
+                                                       _T("BLACK"), wxCROSSDIAG_HATCH
                                                        );
                dc.SetBrush(* brush);