Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
40565211
Commit
40565211
authored
Jun 29, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Jun 29, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Prevent GL calls from DestroyContext() if we failed to make the GL context current.
This can happen if the window is destroyed before the device is released.
parent
6df3f23b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
14 deletions
+22
-14
context.c
dlls/wined3d/context.c
+22
-14
No files found.
dlls/wined3d/context.c
View file @
40565211
...
...
@@ -1158,30 +1158,38 @@ static void RemoveContextFromArray(IWineD3DDeviceImpl *This, WineD3DContext *con
*****************************************************************************/
void
DestroyContext
(
IWineD3DDeviceImpl
*
This
,
WineD3DContext
*
context
)
{
struct
fbo_entry
*
entry
,
*
entry2
;
BOOL
has_glctx
;
TRACE
(
"Destroying ctx %p
\n
"
,
context
);
/* The correct GL context needs to be active to cleanup the GL resources below */
if
(
pwglGetCurrentContext
()
!=
context
->
glCtx
){
pwglMakeCurrent
(
context
->
hdc
,
context
->
glCtx
)
;
last_device
=
NULL
;
}
has_glctx
=
pwglMakeCurrent
(
context
->
hdc
,
context
->
glCtx
);
last_device
=
NULL
;
if
(
!
has_glctx
)
WARN
(
"Failed to activate context. Window already destroyed?
\n
"
);
ENTER_GL
();
LIST_FOR_EACH_ENTRY_SAFE
(
entry
,
entry2
,
&
context
->
fbo_list
,
struct
fbo_entry
,
entry
)
{
if
(
!
has_glctx
)
entry
->
id
=
0
;
context_destroy_fbo_entry
(
This
,
context
,
entry
);
}
if
(
context
->
src_fbo
)
{
TRACE
(
"Destroy src FBO %d
\n
"
,
context
->
src_fbo
);
context_destroy_fbo
(
This
,
&
context
->
src_fbo
);
}
if
(
context
->
dst_fbo
)
{
TRACE
(
"Destroy dst FBO %d
\n
"
,
context
->
dst_fbo
);
context_destroy_fbo
(
This
,
&
context
->
dst_fbo
);
}
if
(
context
->
dummy_arbfp_prog
)
{
GL_EXTCALL
(
glDeleteProgramsARB
(
1
,
&
context
->
dummy_arbfp_prog
));
if
(
has_glctx
)
{
if
(
context
->
src_fbo
)
{
TRACE
(
"Destroy src FBO %d
\n
"
,
context
->
src_fbo
);
context_destroy_fbo
(
This
,
&
context
->
src_fbo
);
}
if
(
context
->
dst_fbo
)
{
TRACE
(
"Destroy dst FBO %d
\n
"
,
context
->
dst_fbo
);
context_destroy_fbo
(
This
,
&
context
->
dst_fbo
);
}
if
(
context
->
dummy_arbfp_prog
)
{
GL_EXTCALL
(
glDeleteProgramsARB
(
1
,
&
context
->
dummy_arbfp_prog
));
}
}
LEAVE_GL
();
...
...
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