DXGL r162 - Code Review
For
DXGL
(
recent comments
|
status changes
|
tags
|
authors
|
states
|
release notes
|
statistics
)
Jump to navigation
Jump to search
Repository:
DXGL
Revision:
<
r161
|
r162
|
r163
>
Date:
21:59, 4 June 2012
Author:
admin
Status:
new
Tags:
Comment:
Stop Allegro apps from getting stuck
Modified paths:
/ddraw/glRenderer.cpp
(modified) (
history
)
Diff
[
purge
]
Index: ddraw/glRenderer.cpp
—
—
@@ -246,7 +246,11 @@
247
247
wndclasscreated = true;
248
248
}
249
249
if(hDC) ReleaseDC(hRenderWnd,hDC);
250
- if(hRenderWnd) DestroyWindow(hRenderWnd);
250
+ if(hRenderWnd)
251
+ {
252
+ SetWindowLongPtr(hRenderWnd,GWLP_USERDATA,0);
253
+ PostMessage(hRenderWnd,WM_CLOSE,0,0);
254
+ }
251
255
RECT rectRender;
252
256
GetClientRect(hWnd,&rectRender);
253
257
if(hWnd)
—
—
@@ -673,10 +677,12 @@
674
678
}
675
679
wglMakeCurrent(NULL,NULL);
676
680
wglDeleteContext(hRC);
681
+ hRC = NULL;
677
682
};
678
683
if(hDC) ReleaseDC(hRenderWnd,hDC);
679
684
hDC = NULL;
680
- DestroyWindow(hRenderWnd);
685
+ SetWindowLongPtr(hRenderWnd,GWLP_USERDATA,0);
686
+ PostMessage(hRenderWnd,WM_CLOSE,0,0);
681
687
hRenderWnd = NULL;
682
688
SetEvent(busy);
683
689
dead = true;
—
—
@@ -1468,9 +1474,6 @@
1469
1475
case WM_CREATE:
1470
1476
SetWindowLongPtr(hwnd,GWLP_USERDATA,(LONG_PTR)this);
1471
1477
return 0;
1472
- case WM_DESTROY:
1473
- PostQuitMessage(0);
1474
- return 0;
1475
1478
case WM_SETCURSOR:
1476
1479
hParent = GetParent(hwnd);
1477
1480
cursor = (HCURSOR)GetClassLong(hParent,GCL_HCURSOR);
—
—
@@ -1524,6 +1527,10 @@
1525
1528
LRESULT CALLBACK RenderWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
1526
1529
{
1527
1530
glRenderer* instance = reinterpret_cast<glRenderer*>(GetWindowLongPtr(hwnd,GWLP_USERDATA));
1531
+ if(msg == WM_DESTROY)
1532
+ {
1533
+ return 0;
1534
+ }
1528
1535
if(!instance)
1529
1536
{
1530
1537
if(msg == WM_CREATE)
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