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
73593cbf
Commit
73593cbf
authored
Jan 29, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Store a separate flag to mark a GDI object for delayed destruction.
parent
827e1f1d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
17 deletions
+19
-17
bitmap.c
dlls/gdi32/bitmap.c
+1
-1
gdi_private.h
dlls/gdi32/gdi_private.h
+4
-3
gdiobj.c
dlls/gdi32/gdiobj.c
+14
-13
No files found.
dlls/gdi32/bitmap.c
View file @
73593cbf
...
...
@@ -586,7 +586,7 @@ static HGDIOBJ BITMAP_SelectObject( HGDIOBJ handle, HDC hdc )
goto
done
;
}
if
(
bitmap
->
header
.
dwC
ount
&&
(
handle
!=
GetStockObject
(
DEFAULT_BITMAP
)))
if
(
bitmap
->
header
.
selc
ount
&&
(
handle
!=
GetStockObject
(
DEFAULT_BITMAP
)))
{
WARN
(
"Bitmap already selected in another DC
\n
"
);
GDI_ReleaseObj
(
handle
);
...
...
dlls/gdi32/gdi_private.h
View file @
73593cbf
...
...
@@ -59,9 +59,10 @@ struct hdc_list
typedef
struct
tagGDIOBJHDR
{
WORD
type
;
WORD
system
:
1
;
DWORD
dwCount
;
WORD
type
;
/* object type (one of the OBJ_* constants) */
WORD
system
:
1
;
/* system object flag */
WORD
deleted
:
1
;
/* whether DeleteObject has been called on this object */
DWORD
selcount
;
/* number of times the object is selected in a DC */
const
struct
gdi_obj_funcs
*
funcs
;
struct
hdc_list
*
hdcs
;
}
GDIOBJHDR
;
...
...
dlls/gdi32/gdiobj.c
View file @
73593cbf
...
...
@@ -528,7 +528,7 @@ HGDIOBJ GDI_inc_ref_count( HGDIOBJ handle )
if
((
header
=
GDI_GetObjPtr
(
handle
,
0
)))
{
header
->
dwC
ount
++
;
header
->
selc
ount
++
;
GDI_ReleaseObj
(
handle
);
}
else
handle
=
0
;
...
...
@@ -548,16 +548,16 @@ BOOL GDI_dec_ref_count( HGDIOBJ handle )
if
((
header
=
GDI_GetObjPtr
(
handle
,
0
)))
{
if
(
header
->
dwCount
)
header
->
dwCount
--
;
if
(
header
->
dwCount
!=
0x80000000
)
GDI_ReleaseObj
(
handle
);
else
assert
(
header
->
selcount
);
if
(
!--
header
->
selcount
&&
header
->
deleted
)
{
/* handle delayed DeleteObject*/
header
->
d
wCount
=
0
;
header
->
d
eleted
=
0
;
GDI_ReleaseObj
(
handle
);
TRACE
(
"executing delayed DeleteObject for %p
\n
"
,
handle
);
DeleteObject
(
handle
);
}
else
GDI_ReleaseObj
(
handle
);
}
return
header
!=
NULL
;
}
...
...
@@ -641,11 +641,12 @@ HGDIOBJ alloc_gdi_handle( GDIOBJHDR *obj, WORD type, const struct gdi_obj_funcs
int
i
;
/* initialize the object header */
obj
->
type
=
type
;
obj
->
system
=
0
;
obj
->
dwCount
=
0
;
obj
->
funcs
=
funcs
;
obj
->
hdcs
=
NULL
;
obj
->
type
=
type
;
obj
->
system
=
0
;
obj
->
deleted
=
0
;
obj
->
selcount
=
0
;
obj
->
funcs
=
funcs
;
obj
->
hdcs
=
NULL
;
_EnterSysLevel
(
&
GDI_level
);
for
(
i
=
next_large_handle
+
1
;
i
<
MAX_LARGE_HANDLES
;
i
++
)
...
...
@@ -796,10 +797,10 @@ BOOL WINAPI DeleteObject( HGDIOBJ obj )
if
(
!
header
)
return
FALSE
;
}
if
(
header
->
dwC
ount
)
if
(
header
->
selc
ount
)
{
TRACE
(
"delayed for %p because object in use, count %
d
\n
"
,
obj
,
header
->
dwC
ount
);
header
->
d
wCount
|=
0x80000000
;
/* mark for delete */
TRACE
(
"delayed for %p because object in use, count %
u
\n
"
,
obj
,
header
->
selc
ount
);
header
->
d
eleted
=
1
;
/* mark for delete */
GDI_ReleaseObj
(
obj
);
return
TRUE
;
}
...
...
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