Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
7dfd6436
Commit
7dfd6436
authored
Aug 31, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check for leaked objects while we still can
parent
fac787fb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
26 deletions
+25
-26
src/misc/objects.c
src/misc/objects.c
+25
-26
No files found.
src/misc/objects.c
View file @
7dfd6436
...
@@ -307,30 +307,6 @@ static void vlc_object_destroy( vlc_object_t *p_this )
...
@@ -307,30 +307,6 @@ static void vlc_object_destroy( vlc_object_t *p_this )
free
(
p_this
->
psz_header
);
free
(
p_this
->
psz_header
);
#ifndef NDEBUG
if
(
VLC_OBJECT
(
p_this
->
p_libvlc
)
==
p_this
)
{
/* Test for leaks */
vlc_object_t
*
leaked
=
p_priv
->
next
;
while
(
leaked
!=
p_this
)
{
/* We are leaking this object */
fprintf
(
stderr
,
"ERROR: leaking object (id:%i, type:%s, name:%s)
\n
"
,
leaked
->
i_object_id
,
leaked
->
psz_object_type
,
leaked
->
psz_object_name
);
/* Dump object to ease debugging */
vlc_object_dump
(
leaked
);
fflush
(
stderr
);
leaked
=
vlc_internals
(
leaked
)
->
next
;
}
if
(
p_priv
->
next
!=
p_this
)
/* Dump libvlc object to ease debugging */
vlc_object_dump
(
p_this
);
}
#endif
if
(
p_this
->
p_libvlc
==
NULL
)
if
(
p_this
->
p_libvlc
==
NULL
)
/* We are the global object ... no need to lock. */
/* We are the global object ... no need to lock. */
vlc_mutex_destroy
(
&
structure_lock
);
vlc_mutex_destroy
(
&
structure_lock
);
...
@@ -743,6 +719,29 @@ void __vlc_object_release( vlc_object_t *p_this )
...
@@ -743,6 +719,29 @@ void __vlc_object_release( vlc_object_t *p_this )
if
(
b_should_destroy
)
if
(
b_should_destroy
)
{
{
#ifndef NDEBUG
if
(
VLC_OBJECT
(
p_this
->
p_libvlc
)
==
p_this
)
{
/* Test for leaks */
vlc_object_t
*
leaked
=
internals
->
next
;
while
(
leaked
!=
p_this
)
{
/* We are leaking this object */
fprintf
(
stderr
,
"ERROR: leaking object (id:%i, type:%s, name:%s)
\n
"
,
leaked
->
i_object_id
,
leaked
->
psz_object_type
,
leaked
->
psz_object_name
);
/* Dump object to ease debugging */
vlc_object_dump
(
leaked
);
fflush
(
stderr
);
leaked
=
vlc_internals
(
leaked
)
->
next
;
}
if
(
internals
->
next
!=
p_this
)
/* Dump libvlc object to ease debugging */
vlc_object_dump
(
p_this
);
}
#endif
/* Remove the object from object list
/* Remove the object from object list
* so that it cannot be encountered by vlc_object_get() */
* so that it cannot be encountered by vlc_object_get() */
vlc_internals
(
internals
->
next
)
->
prev
=
internals
->
prev
;
vlc_internals
(
internals
->
next
)
->
prev
=
internals
->
prev
;
...
@@ -1102,11 +1101,11 @@ void vlc_list_release( vlc_list_t *p_list )
...
@@ -1102,11 +1101,11 @@ void vlc_list_release( vlc_list_t *p_list )
*****************************************************************************/
*****************************************************************************/
void
__vlc_object_dump
(
vlc_object_t
*
p_this
)
void
__vlc_object_dump
(
vlc_object_t
*
p_this
)
{
{
vlc_mutex_lock
(
&
structure_lock
);
char
psz_foo
[
2
*
MAX_DUMPSTRUCTURE_DEPTH
+
1
];
char
psz_foo
[
2
*
MAX_DUMPSTRUCTURE_DEPTH
+
1
];
psz_foo
[
0
]
=
'|'
;
psz_foo
[
0
]
=
'|'
;
vlc_assert_locked
(
&
structure_lock
);
DumpStructure
(
p_this
,
0
,
psz_foo
);
DumpStructure
(
p_this
,
0
,
psz_foo
);
vlc_mutex_unlock
(
&
structure_lock
);
}
}
/* Following functions are local */
/* Following functions are local */
...
...
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