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
f75b7e87
Commit
f75b7e87
authored
Oct 12, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Improve tracing of GDI objects to make leaks easier to spot.
parent
50195920
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
gdiobj.c
dlls/gdi32/gdiobj.c
+6
-2
No files found.
dlls/gdi32/gdiobj.c
View file @
f75b7e87
...
@@ -635,6 +635,7 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
...
@@ -635,6 +635,7 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
#define MAX_LARGE_HANDLES ((GDI_HEAP_SIZE >> 2) - FIRST_LARGE_HANDLE)
#define MAX_LARGE_HANDLES ((GDI_HEAP_SIZE >> 2) - FIRST_LARGE_HANDLE)
static
GDIOBJHDR
*
large_handles
[
MAX_LARGE_HANDLES
];
static
GDIOBJHDR
*
large_handles
[
MAX_LARGE_HANDLES
];
static
int
next_large_handle
;
static
int
next_large_handle
;
static
LONG
debug_count
;
static
const
char
*
gdi_obj_type
(
unsigned
type
)
static
const
char
*
gdi_obj_type
(
unsigned
type
)
{
{
...
@@ -712,6 +713,9 @@ HGDIOBJ alloc_gdi_handle( GDIOBJHDR *obj, WORD type, const struct gdi_obj_funcs
...
@@ -712,6 +713,9 @@ HGDIOBJ alloc_gdi_handle( GDIOBJHDR *obj, WORD type, const struct gdi_obj_funcs
large_handles
[
i
]
=
obj
;
large_handles
[
i
]
=
obj
;
next_large_handle
=
i
;
next_large_handle
=
i
;
LeaveCriticalSection
(
&
gdi_section
);
LeaveCriticalSection
(
&
gdi_section
);
TRACE
(
"allocated %s %p %u/%u
\n
"
,
gdi_obj_type
(
type
),
(
HGDIOBJ
)(
ULONG_PTR
)((
i
+
FIRST_LARGE_HANDLE
)
<<
2
),
InterlockedIncrement
(
&
debug_count
),
MAX_LARGE_HANDLES
);
return
(
HGDIOBJ
)(
ULONG_PTR
)((
i
+
FIRST_LARGE_HANDLE
)
<<
2
);
return
(
HGDIOBJ
)(
ULONG_PTR
)((
i
+
FIRST_LARGE_HANDLE
)
<<
2
);
}
}
...
@@ -736,6 +740,8 @@ void *free_gdi_handle( HGDIOBJ handle )
...
@@ -736,6 +740,8 @@ void *free_gdi_handle( HGDIOBJ handle )
}
}
if
(
object
)
if
(
object
)
{
{
TRACE
(
"freed %s %p %u/%u
\n
"
,
gdi_obj_type
(
object
->
type
),
handle
,
InterlockedDecrement
(
&
debug_count
)
+
1
,
MAX_LARGE_HANDLES
);
object
->
type
=
0
;
/* mark it as invalid */
object
->
type
=
0
;
/* mark it as invalid */
object
->
funcs
=
NULL
;
object
->
funcs
=
NULL
;
}
}
...
@@ -769,7 +775,6 @@ void *GDI_GetObjPtr( HGDIOBJ handle, WORD type )
...
@@ -769,7 +775,6 @@ void *GDI_GetObjPtr( HGDIOBJ handle, WORD type )
LeaveCriticalSection
(
&
gdi_section
);
LeaveCriticalSection
(
&
gdi_section
);
WARN
(
"Invalid handle %p
\n
"
,
handle
);
WARN
(
"Invalid handle %p
\n
"
,
handle
);
}
}
else
TRACE
(
"(%p): enter %d
\n
"
,
handle
,
gdi_section
.
RecursionCount
);
return
ptr
;
return
ptr
;
}
}
...
@@ -781,7 +786,6 @@ void *GDI_GetObjPtr( HGDIOBJ handle, WORD type )
...
@@ -781,7 +786,6 @@ void *GDI_GetObjPtr( HGDIOBJ handle, WORD type )
*/
*/
void
GDI_ReleaseObj
(
HGDIOBJ
handle
)
void
GDI_ReleaseObj
(
HGDIOBJ
handle
)
{
{
TRACE
(
"(%p): leave %d
\n
"
,
handle
,
gdi_section
.
RecursionCount
);
LeaveCriticalSection
(
&
gdi_section
);
LeaveCriticalSection
(
&
gdi_section
);
}
}
...
...
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