DXGL r17 - Code Review
For
DXGL
(
recent comments
|
status changes
|
tags
|
authors
|
states
|
release notes
|
statistics
)
Jump to navigation
Jump to search
Repository:
DXGL
Revision:
<
r16
|
r17
|
r18
>
Date:
03:32, 4 December 2011
Author:
admin
Status:
new
Tags:
Comment:
Fix palette memory leak in dxgltest
Modified paths:
/dxgltest/Tests2D.cpp
(modified) (
history
)
Diff
[
purge
]
Index: dxgltest/Tests2D.cpp
—
—
@@ -39,6 +39,7 @@
40
40
MultiDirectDraw *ddinterface;
41
41
MultiDirectDrawSurface *ddsurface;
42
42
MultiDirectDrawSurface *ddsrender;
43
+IDirectDrawPalette *pal;
43
44
LPDIRECTDRAWCLIPPER ddclipper;
44
45
int width,height,bpp,refresh,backbuffers;
45
46
double fps;
—
—
@@ -88,6 +89,11 @@
89
90
ddsurface->Release();
90
91
ddsurface = NULL;
91
92
}
93
+ if(pal)
94
+ {
95
+ pal->Release();
96
+ pal = NULL;
97
+ }
92
98
if(ddclipper)
93
99
{
94
100
ddclipper->Release();
—
—
@@ -227,11 +233,10 @@
228
234
}
229
235
if(bpp == 8)
230
236
{
231
- IDirectDrawPalette *pal;
232
237
ddinterface->CreatePalette(DDPCAPS_8BIT|DDPCAPS_ALLOW256,(LPPALETTEENTRY)&DefaultPalette,&pal,NULL);
233
238
ddsrender->SetPalette(pal);
234
- pal->Release();
235
239
}
240
+ else pal = NULL;
236
241
InitTest(testnum);
237
242
if(!fullscreen) SendMessage(hWnd,WM_PAINT,0,0);
238
243
if(testtypes[testnum] == 1)
Navigation menu
Personal tools
Log in
Namespaces
Special page
English
expanded
collapsed
Views
More
expanded
collapsed
Search
Navigation
Home
Main page
Recent changes
Random page
MediaWiki help
Introduction
Progress
Downloads
Source code
Build from source
AppDB
Bug reports
Forums
Tools
Special pages
Printable version