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
1036ca0d
Commit
1036ca0d
authored
Feb 16, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Feb 19, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Creating surfaces with old interfaces doesn't addref.
parent
68e7ed2c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
7 deletions
+27
-7
ddraw_thunks.c
dlls/ddraw/ddraw_thunks.c
+2
-4
surface.c
dlls/ddraw/surface.c
+1
-1
refcount.c
dlls/ddraw/tests/refcount.c
+24
-2
No files found.
dlls/ddraw/ddraw_thunks.c
View file @
1036ca0d
...
...
@@ -410,8 +410,7 @@ IDirectDrawImpl_CreateSurface(LPDIRECTDRAW This, LPDDSURFACEDESC pSDesc,
IDirectDraw
,
IDirectDraw7
,
This
));
IDirectDraw_AddRef
(
This
);
impl
->
ifaceToRelease
=
(
IUnknown
*
)
This
;
impl
->
ifaceToRelease
=
NULL
;
}
return
hr
;
...
...
@@ -446,8 +445,7 @@ IDirectDraw2Impl_CreateSurface(LPDIRECTDRAW2 This, LPDDSURFACEDESC pSDesc,
IDirectDraw2
,
IDirectDraw7
,
This
));
IDirectDraw2_AddRef
(
This
);
impl
->
ifaceToRelease
=
(
IUnknown
*
)
This
;
impl
->
ifaceToRelease
=
NULL
;
}
return
hr
;
...
...
dlls/ddraw/surface.c
View file @
1036ca0d
...
...
@@ -376,7 +376,7 @@ IDirectDrawSurfaceImpl_Release(IDirectDrawSurface7 *iface)
IDirectDrawSurfaceImpl_Destroy
(
This
);
/* Reduce the ddraw refcount */
IUnknown_Release
(
ifaceToRelease
);
if
(
ifaceToRelease
)
IUnknown_Release
(
ifaceToRelease
);
}
return
ref
;
...
...
dlls/ddraw/tests/refcount.c
View file @
1036ca0d
...
...
@@ -49,10 +49,12 @@ static void test_ddraw_objects(void)
unsigned
long
ref
;
IDirectDraw7
*
DDraw7
;
IDirectDraw4
*
DDraw4
;
IDirectDraw
4
*
DDraw2
;
IDirectDraw
4
*
DDraw1
;
IDirectDraw
2
*
DDraw2
;
IDirectDraw
*
DDraw1
;
IDirectDrawPalette
*
palette
;
IDirectDrawSurface7
*
surface
;
IDirectDrawSurface
*
surface1
;
IDirectDrawSurface4
*
surface4
;
PALETTEENTRY
Table
[
256
];
DDSURFACEDESC2
ddsd
;
...
...
@@ -163,6 +165,26 @@ static void test_ddraw_objects(void)
ok
(
ref
==
1
,
"Got refcount %ld, expected 1
\n
"
,
ref
);
IDirectDrawPalette_Release
(
palette
);
/* Simmilar for surfaces */
hr
=
IDirectDraw4_CreateSurface
(
DDraw4
,
&
ddsd
,
&
surface4
,
NULL
);
ok
(
hr
==
DD_OK
,
"CreateSurface returned %08x
\n
"
,
hr
);
ref
=
getRefcount
(
(
IUnknown
*
)
DDraw4
);
ok
(
ref
==
2
,
"Got refcount %ld, expected 2
\n
"
,
ref
);
IDirectDrawSurface4_Release
(
surface4
);
ddsd
.
dwSize
=
sizeof
(
DDSURFACEDESC
);
hr
=
IDirectDraw2_CreateSurface
(
DDraw2
,
(
DDSURFACEDESC
*
)
&
ddsd
,
&
surface1
,
NULL
);
ok
(
hr
==
DD_OK
,
"CreateSurface returned %08x
\n
"
,
hr
);
ref
=
getRefcount
(
(
IUnknown
*
)
DDraw2
);
ok
(
ref
==
1
,
"Got refcount %ld, expected 1
\n
"
,
ref
);
IDirectDrawSurface_Release
(
surface1
);
hr
=
IDirectDraw_CreateSurface
(
DDraw1
,
(
DDSURFACEDESC
*
)
&
ddsd
,
&
surface1
,
NULL
);
ok
(
hr
==
DD_OK
,
"CreateSurface returned %08x
\n
"
,
hr
);
ref
=
getRefcount
(
(
IUnknown
*
)
DDraw1
);
ok
(
ref
==
1
,
"Got refcount %ld, expected 1
\n
"
,
ref
);
IDirectDrawSurface_Release
(
surface1
);
IDirectDraw7_Release
(
DDraw7
);
IDirectDraw4_Release
(
DDraw4
);
IDirectDraw2_Release
(
DDraw2
);
...
...
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