projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed a big memory leak in DoDrawBitmap() (coverity checker CID 57)
[wxWidgets.git]
/
src
/
os2
/
dcmemory.cpp
diff --git
a/src/os2/dcmemory.cpp
b/src/os2/dcmemory.cpp
index bfdb10ce833beaa5c7657ee5693f274fd9492fe9..a786f316410c4d942577bccf6ef73007aacf8998 100644
(file)
--- a/
src/os2/dcmemory.cpp
+++ b/
src/os2/dcmemory.cpp
@@
-6,7
+6,7
@@
// Created: 10/14/99
// RCS-ID: $Id$
// Copyright: (c) David Webster
// Created: 10/14/99
// RCS-ID: $Id$
// Copyright: (c) David Webster
-// Licence: wxWi
dget
s licence
+// Licence: wxWi
ndow
s licence
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx.h".
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx.h".
@@
-38,9
+38,7
@@
wxMemoryDC::wxMemoryDC(
wxDC* pOldDC
)
{
wxDC* pOldDC
)
{
- pOldDC->BeginDrawing();
CreateCompatible(pOldDC);
CreateCompatible(pOldDC);
- pOldDC->EndDrawing();
Init();
} // end of wxMemoryDC::wxMemoryDC
Init();
} // end of wxMemoryDC::wxMemoryDC
@@
-58,14
+56,12
@@
void wxMemoryDC::Init()
memset(&m_vRclPaint, 0, sizeof(m_vRclPaint));
} // end of wxMemoryDC::Init
memset(&m_vRclPaint, 0, sizeof(m_vRclPaint));
} // end of wxMemoryDC::Init
-bool wxMemoryDC::CreateCompatible(
- wxDC* pDC
-)
+bool wxMemoryDC::CreateCompatible( wxDC* WXUNUSED(pDC) )
{
{
- HDC
hDC;
- HPS
hPS;
- DEVOPENSTRUC
vDOP = {0L, "DISPLAY", NULL, 0L, 0L, 0L, 0L, 0L, 0L};
- SIZEL
vSize = {0, 0};
+ HDC hDC;
+ HPS hPS;
+ DEVOPENSTRUC vDOP = {0L, "DISPLAY", NULL, 0L, 0L, 0L, 0L, 0L, 0L};
+ SIZEL vSize = {0, 0};
//
// Create a memory device context
//
// Create a memory device context
@@
-78,8
+74,8
@@
bool wxMemoryDC::CreateCompatible(
{
m_hPS = hPS;
m_hDC = hDC;
{
m_hPS = hPS;
m_hDC = hDC;
- m_ok =
TRUE
;
- m_bOwnsDC =
TRUE
;
+ m_ok =
true
;
+ m_bOwnsDC =
true
;
//
// Set the wxWidgets color table
//
//
// Set the wxWidgets color table
//
@@
-117,7
+113,7
@@
bool wxMemoryDC::CreateCompatible(
//
// As we created the DC, we must delete it in the dtor
//
//
// As we created the DC, we must delete it in the dtor
//
- m_bOwnsDC =
TRUE
;
+ m_bOwnsDC =
true
;
m_ok = m_hDC != 0;
return m_ok;
} // end of wxMemoryDC::CreateCompatible
m_ok = m_hDC != 0;
return m_ok;
} // end of wxMemoryDC::CreateCompatible
@@
-202,4
+198,3
@@
void wxMemoryDC::DoGetSize(
*pWidth = m_vSelectedBitmap.GetWidth();
*pHeight = m_vSelectedBitmap.GetHeight();
} // end of wxMemoryDC::DoGetSize
*pWidth = m_vSelectedBitmap.GetWidth();
*pHeight = m_vSelectedBitmap.GetHeight();
} // end of wxMemoryDC::DoGetSize
-