Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
38f820eb
Commit
38f820eb
authored
May 14, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Inline DetachObject
parent
c79a340d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
35 deletions
+30
-35
src/misc/objects.c
src/misc/objects.c
+30
-35
No files found.
src/misc/objects.c
View file @
38f820eb
...
...
@@ -70,7 +70,6 @@ static int DumpCommand( vlc_object_t *, char const *,
static
vlc_object_t
*
FindObject
(
vlc_object_t
*
,
int
,
int
);
static
vlc_object_t
*
FindObjectName
(
vlc_object_t
*
,
const
char
*
,
int
);
static
void
DetachObject
(
vlc_object_t
*
);
static
void
PrintObject
(
vlc_object_t
*
,
const
char
*
);
static
void
DumpStructure
(
vlc_object_t
*
,
int
,
char
*
);
static
int
FindIndex
(
vlc_object_t
*
,
vlc_object_t
**
,
int
);
...
...
@@ -915,7 +914,36 @@ static void vlc_object_detach_unlocked (vlc_object_t *p_this)
{
assert
(
p_this
->
p_parent
);
DetachObject
(
p_this
);
vlc_object_t
*
p_parent
=
p_this
->
p_parent
;
int
i_index
,
i
;
/* Remove p_this's parent */
p_this
->
p_parent
=
NULL
;
/* Remove all of p_parent's children which are p_this */
for
(
i_index
=
p_parent
->
i_children
;
i_index
--
;
)
{
if
(
p_parent
->
pp_children
[
i_index
]
==
p_this
)
{
p_parent
->
i_children
--
;
for
(
i
=
i_index
;
i
<
p_parent
->
i_children
;
i
++
)
{
p_parent
->
pp_children
[
i
]
=
p_parent
->
pp_children
[
i
+
1
];
}
}
}
if
(
p_parent
->
i_children
)
{
p_parent
->
pp_children
=
(
vlc_object_t
**
)
realloc
(
p_parent
->
pp_children
,
p_parent
->
i_children
*
sizeof
(
vlc_object_t
*
)
);
}
else
{
/* Special case - don't realloc() to zero to avoid leaking */
free
(
p_parent
->
pp_children
);
p_parent
->
pp_children
=
NULL
;
}
}
...
...
@@ -1351,39 +1379,6 @@ static vlc_object_t * FindObjectName( vlc_object_t *p_this,
return
NULL
;
}
static
void
DetachObject
(
vlc_object_t
*
p_this
)
{
vlc_object_t
*
p_parent
=
p_this
->
p_parent
;
int
i_index
,
i
;
/* Remove p_this's parent */
p_this
->
p_parent
=
NULL
;
/* Remove all of p_parent's children which are p_this */
for
(
i_index
=
p_parent
->
i_children
;
i_index
--
;
)
{
if
(
p_parent
->
pp_children
[
i_index
]
==
p_this
)
{
p_parent
->
i_children
--
;
for
(
i
=
i_index
;
i
<
p_parent
->
i_children
;
i
++
)
{
p_parent
->
pp_children
[
i
]
=
p_parent
->
pp_children
[
i
+
1
];
}
}
}
if
(
p_parent
->
i_children
)
{
p_parent
->
pp_children
=
(
vlc_object_t
**
)
realloc
(
p_parent
->
pp_children
,
p_parent
->
i_children
*
sizeof
(
vlc_object_t
*
)
);
}
else
{
free
(
p_parent
->
pp_children
);
p_parent
->
pp_children
=
NULL
;
}
}
static
void
PrintObject
(
vlc_object_t
*
p_this
,
const
char
*
psz_prefix
)
{
...
...
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