#include "wx/sysopt.h"
#include "wx/dcprint.h"
+#include "wx/module.h"
#include <string.h>
#include <math.h>
wxDCCacheEntry* dcCacheEntry1 = FindDCInCache(NULL, source->GetHDC());
dc_mask = (HDC) dcCacheEntry1->m_dc;
- wxDCCacheEntry* dcCacheEntry2 = FindDCInCache(dcCacheEntry1, dest->GetHDC());
+ wxDCCacheEntry* dcCacheEntry2 = FindDCInCache(dcCacheEntry1, GetHDC());
dc_buffer = (HDC) dcCacheEntry2->m_dc;
- wxDCCacheEntry* bitmapCacheEntry = FindBitmapInCache(dest->GetHDC(),
+ wxDCCacheEntry* bitmapCacheEntry = FindBitmapInCache(GetHDC(),
width, height);
buffer_bmap = (HBITMAP) bitmapCacheEntry->m_bitmap;
sm_dcCache.DeleteContents(FALSE);
}
+// Clean up cache at app exit
+class wxDCModule : public wxModule
+{
+public:
+ virtual bool OnInit() { return TRUE; }
+ virtual void OnExit() { wxDC::ClearCache(); }
+
+private:
+ DECLARE_DYNAMIC_CLASS(wxDCModule)
+};
+
+IMPLEMENT_DYNAMIC_CLASS(wxDCModule, wxModule)
+
#endif
// wxUSE_DC_CACHEING