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
ee349306
Commit
ee349306
authored
Nov 25, 2022
by
Matteo Bruni
Committed by
Alexandre Julliard
Nov 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Destroy primary GL context if initialization fails.
parent
242cdaee
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
2 deletions
+26
-2
device.c
dlls/wined3d/device.c
+5
-2
swapchain.c
dlls/wined3d/swapchain.c
+19
-0
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-0
No files found.
dlls/wined3d/device.c
View file @
ee349306
...
...
@@ -1256,10 +1256,13 @@ void wined3d_device_gl_create_primary_opengl_context_cs(void *object)
return
;
}
context_gl
=
wined3d_context_gl
(
context
);
if
(
!
wined3d_allocator_init
(
&
device_gl
->
allocator
,
ARRAY_SIZE
(
gl_memory_types
),
&
wined3d_allocator_gl_ops
))
{
WARN
(
"Failed to initialise allocator.
\n
"
);
context_release
(
context
);
wined3d_swapchain_gl_context_destroy
(
wined3d_swapchain_gl
(
swapchain
),
context_gl
);
return
;
}
...
...
@@ -1269,6 +1272,7 @@ void wined3d_device_gl_create_primary_opengl_context_cs(void *object)
ERR
(
"Failed to allocate shader private data, hr %#x.
\n
"
,
hr
);
wined3d_allocator_cleanup
(
&
device_gl
->
allocator
);
context_release
(
context
);
wined3d_swapchain_gl_context_destroy
(
wined3d_swapchain_gl
(
swapchain
),
context_gl
);
return
;
}
...
...
@@ -1278,11 +1282,10 @@ void wined3d_device_gl_create_primary_opengl_context_cs(void *object)
device
->
shader_backend
->
shader_free_private
(
device
,
NULL
);
wined3d_allocator_cleanup
(
&
device_gl
->
allocator
);
context_release
(
context
);
wined3d_swapchain_gl_context_destroy
(
wined3d_swapchain_gl
(
swapchain
),
context_gl
);
return
;
}
context_gl
=
wined3d_context_gl
(
context
);
wined3d_ffp_blitter_create
(
&
device
->
blitter
,
context_gl
->
gl_info
);
if
(
!
wined3d_glsl_blitter_create
(
&
device
->
blitter
,
device
))
wined3d_arbfp_blitter_create
(
&
device
->
blitter
,
device
);
...
...
dlls/wined3d/swapchain.c
View file @
ee349306
...
...
@@ -1804,6 +1804,25 @@ static struct wined3d_context_gl *wined3d_swapchain_gl_create_context(struct win
return
context_gl
;
}
void
wined3d_swapchain_gl_context_destroy
(
struct
wined3d_swapchain_gl
*
swapchain_gl
,
struct
wined3d_context_gl
*
context_gl
)
{
unsigned
int
i
,
j
;
TRACE
(
"swapchain_gl %p, context_gl %p.
\n
"
,
swapchain_gl
,
context_gl
);
for
(
i
=
0
;
i
<
swapchain_gl
->
context_count
;
++
i
)
{
if
(
swapchain_gl
->
contexts
[
i
]
==
context_gl
)
{
wined3d_context_gl_destroy
(
swapchain_gl
->
contexts
[
i
]);
for
(
j
=
i
;
j
<
--
swapchain_gl
->
context_count
;
++
j
)
swapchain_gl
->
contexts
[
j
]
=
swapchain_gl
->
contexts
[
j
+
1
];
return
;
}
}
ERR
(
"context_gl %p not found in the swapchain list.
\n
"
,
context_gl
);
}
void
wined3d_swapchain_gl_destroy_contexts
(
struct
wined3d_swapchain_gl
*
swapchain_gl
)
{
unsigned
int
i
;
...
...
dlls/wined3d/wined3d_private.h
View file @
ee349306
...
...
@@ -5720,6 +5720,8 @@ static inline struct wined3d_swapchain_gl *wined3d_swapchain_gl(struct wined3d_s
}
void
wined3d_swapchain_gl_cleanup
(
struct
wined3d_swapchain_gl
*
swapchain_gl
)
DECLSPEC_HIDDEN
;
void
wined3d_swapchain_gl_context_destroy
(
struct
wined3d_swapchain_gl
*
swapchain_gl
,
struct
wined3d_context_gl
*
context_gl
)
DECLSPEC_HIDDEN
;
void
wined3d_swapchain_gl_destroy_contexts
(
struct
wined3d_swapchain_gl
*
swapchain_gl
)
DECLSPEC_HIDDEN
;
struct
wined3d_context_gl
*
wined3d_swapchain_gl_get_context
(
struct
wined3d_swapchain_gl
*
swapchain_gl
)
DECLSPEC_HIDDEN
;
HRESULT
wined3d_swapchain_gl_init
(
struct
wined3d_swapchain_gl
*
swapchain_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