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
8fc4e3ce
Commit
8fc4e3ce
authored
Oct 09, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Oct 10, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Clear up in Init3D if something fails.
parent
4bf62af0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
6 deletions
+22
-6
device.c
dlls/wined3d/device.c
+22
-6
No files found.
dlls/wined3d/device.c
View file @
8fc4e3ce
...
...
@@ -1952,15 +1952,16 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Init3D(IWineD3DDevice *iface, WINED3DPR
NULL
);
if
(
WINED3D_OK
!=
hr
)
{
/* Note: No parent needed for initial internal stateblock */
WARN
(
"Failed to create stateblock
\n
"
);
return
hr
;
goto
err_out
;
}
TRACE
(
"(%p) : Created stateblock (%p)
\n
"
,
This
,
This
->
stateBlock
);
This
->
updateStateBlock
=
This
->
stateBlock
;
IWineD3DStateBlock_AddRef
((
IWineD3DStateBlock
*
)
This
->
updateStateBlock
);
hr
=
allocate_shader_constants
(
This
->
updateStateBlock
);
if
(
WINED3D_OK
!=
hr
)
return
hr
;
if
(
WINED3D_OK
!=
hr
)
{
goto
err_out
;
}
This
->
render_targets
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IWineD3DSurface
*
)
*
GL_LIMITS
(
buffers
));
This
->
fbo_color_attachments
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IWineD3DSurface
*
)
*
GL_LIMITS
(
buffers
));
...
...
@@ -1982,15 +1983,14 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Init3D(IWineD3DDevice *iface, WINED3DPR
hr
=
D3DCB_CreateAdditionalSwapChain
((
IUnknown
*
)
This
->
parent
,
pPresentationParameters
,
(
IWineD3DSwapChain
**
)
&
swapchain
);
if
(
FAILED
(
hr
)
||
!
swapchain
)
{
WARN
(
"Failed to create implicit swapchain
\n
"
);
return
hr
;
goto
err_out
;
}
This
->
NumberOfSwapChains
=
1
;
This
->
swapchains
=
HeapAlloc
(
GetProcessHeap
(),
0
,
This
->
NumberOfSwapChains
*
sizeof
(
IWineD3DSwapChain
*
));
if
(
!
This
->
swapchains
)
{
ERR
(
"Out of memory!
\n
"
);
IWineD3DSwapChain_Release
(
(
IWineD3DSwapChain
*
)
swapchain
);
return
E_OUTOFMEMORY
;
goto
err_out
;
}
This
->
swapchains
[
0
]
=
(
IWineD3DSwapChain
*
)
swapchain
;
...
...
@@ -2074,6 +2074,22 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Init3D(IWineD3DDevice *iface, WINED3DPR
IWineD3DDeviceImpl_LoadLogo
(
This
,
wined3d_settings
.
logo
);
}
return
WINED3D_OK
;
err_out:
HeapFree
(
GetProcessHeap
(),
0
,
This
->
render_targets
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
fbo_color_attachments
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
draw_buffers
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
swapchains
);
This
->
NumberOfSwapChains
=
0
;
if
(
swapchain
)
{
IWineD3DSwapChain_Release
(
(
IWineD3DSwapChain
*
)
swapchain
);
}
This
->
draw_buffers
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
GLenum
)
*
GL_LIMITS
(
buffers
));
if
(
This
->
stateBlock
)
{
IWineD3DStateBlock_Release
((
IWineD3DStateBlock
*
)
This
->
stateBlock
);
This
->
stateBlock
=
NULL
;
}
return
hr
;
}
static
HRESULT
WINAPI
IWineD3DDeviceImpl_Uninit3D
(
IWineD3DDevice
*
iface
,
D3DCB_DESTROYSURFACEFN
D3DCB_DestroyDepthStencilSurface
,
D3DCB_DESTROYSWAPCHAINFN
D3DCB_DestroySwapChain
)
{
...
...
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