Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
401173ff
Commit
401173ff
authored
Oct 28, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Oct 28, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Restore the thread's previous GL context in context_destroy_gl_resources().
parent
7cc43213
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
7 deletions
+18
-7
context.c
dlls/wined3d/context.c
+18
-7
No files found.
dlls/wined3d/context.c
View file @
401173ff
...
...
@@ -659,9 +659,15 @@ static void context_destroy_gl_resources(struct wined3d_context *context)
struct
wined3d_occlusion_query
*
occlusion_query
;
struct
wined3d_event_query
*
event_query
;
struct
fbo_entry
*
entry
,
*
entry2
;
HGLRC
restore_ctx
;
HDC
restore_dc
;
restore_ctx
=
pwglGetCurrentContext
();
restore_dc
=
pwglGetCurrentDC
();
context_validate
(
context
);
if
(
context
->
valid
)
pwglMakeCurrent
(
context
->
hdc
,
context
->
glCtx
);
if
(
context
->
valid
&&
restore_ctx
!=
context
->
glCtx
)
pwglMakeCurrent
(
context
->
hdc
,
context
->
glCtx
);
else
restore_ctx
=
NULL
;
ENTER_GL
();
...
...
@@ -727,7 +733,16 @@ static void context_destroy_gl_resources(struct wined3d_context *context)
HeapFree
(
GetProcessHeap
(),
0
,
context
->
free_occlusion_queries
);
HeapFree
(
GetProcessHeap
(),
0
,
context
->
free_event_queries
);
if
(
pwglGetCurrentContext
()
&&
!
pwglMakeCurrent
(
NULL
,
NULL
))
if
(
restore_ctx
)
{
if
(
!
pwglMakeCurrent
(
restore_dc
,
restore_ctx
))
{
DWORD
err
=
GetLastError
();
ERR
(
"Failed to restore GL context %p on device context %p, last error %#x.
\n
"
,
restore_ctx
,
restore_dc
,
err
);
}
}
else
if
(
pwglGetCurrentContext
()
&&
!
pwglMakeCurrent
(
NULL
,
NULL
))
{
ERR
(
"Failed to disable GL context.
\n
"
);
}
...
...
@@ -1511,12 +1526,8 @@ void DestroyContext(IWineD3DDeviceImpl *This, struct wined3d_context *context)
if
(
context
->
tid
==
GetCurrentThreadId
()
||
!
context
->
current
)
{
context_destroy_gl_resources
(
context
);
TlsSetValue
(
wined3d_context_tls_idx
,
NULL
);
destroy
=
TRUE
;
if
(
!
context_set_current
(
NULL
))
{
ERR
(
"Failed to clear current D3D context.
\n
"
);
}
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment