Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
5f491204
Commit
5f491204
authored
Feb 02, 2010
by
Jakob Leben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input_item_node_Delete: fix leakage and lessen complexity
parent
4e65194e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
src/input/item.c
src/input/item.c
+12
-7
No files found.
src/input/item.c
View file @
5f491204
...
...
@@ -998,15 +998,21 @@ input_item_node_t *input_item_node_Create( input_item_t *p_input )
return
p_node
;
}
void
input_item_node_
Delete
(
input_item_node_t
*
p_node
)
static
void
RecursiveNode
Delete
(
input_item_node_t
*
p_node
)
{
int
i
;
for
(
i
=
0
;
i
<
p_node
->
i_children
;
i
++
)
input_item_node_Delete
(
p_node
->
pp_children
[
i
]
);
for
(
int
i
=
0
;
i
<
p_node
->
i_children
;
i
++
)
RecursiveNodeDelete
(
p_node
->
pp_children
[
i
]
);
vlc_gc_decref
(
p_node
->
p_item
);
free
(
p_node
->
pp_children
);
free
(
p_node
);
}
void
input_item_node_Delete
(
input_item_node_t
*
p_node
)
{
if
(
p_node
->
p_parent
)
{
for
(
i
=
0
;
i
<
p_node
->
p_parent
->
i_children
;
i
++
)
for
(
i
nt
i
=
0
;
i
<
p_node
->
p_parent
->
i_children
;
i
++
)
if
(
p_node
->
p_parent
->
pp_children
[
i
]
==
p_node
)
{
REMOVE_ELEM
(
p_node
->
p_parent
->
pp_children
,
...
...
@@ -1016,8 +1022,7 @@ void input_item_node_Delete( input_item_node_t *p_node )
}
}
vlc_gc_decref
(
p_node
->
p_item
);
free
(
p_node
);
RecursiveNodeDelete
(
p_node
);
}
input_item_node_t
*
input_item_node_AppendItem
(
input_item_node_t
*
p_node
,
input_item_t
*
p_item
)
...
...
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