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
c8a5ee83
Commit
c8a5ee83
authored
Dec 30, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Factor variable destruction code (out of the variable lock)
parent
edecf92c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
35 deletions
+21
-35
src/misc/variables.c
src/misc/variables.c
+21
-35
No files found.
src/misc/variables.c
View file @
c8a5ee83
...
...
@@ -165,6 +165,25 @@ static int InheritValue( vlc_object_t *, const char *, vlc_value_t *,
static
int
TriggerCallback
(
vlc_object_t
*
,
variable_t
*
,
const
char
*
,
vlc_value_t
);
static
void
Destroy
(
variable_t
*
p_var
)
{
p_var
->
ops
->
pf_free
(
&
p_var
->
val
);
if
(
p_var
->
choices
.
i_count
)
{
for
(
int
i
=
0
;
i
<
p_var
->
choices
.
i_count
;
i
++
)
{
p_var
->
ops
->
pf_free
(
&
p_var
->
choices
.
p_values
[
i
]
);
free
(
p_var
->
choices_text
.
p_values
[
i
].
psz_string
);
}
free
(
p_var
->
choices
.
p_values
);
free
(
p_var
->
choices_text
.
p_values
);
}
free
(
p_var
->
psz_name
);
free
(
p_var
->
psz_text
);
free
(
p_var
->
p_entries
);
free
(
p_var
);
}
/**
* Initialize a vlc variable
*
...
...
@@ -293,19 +312,7 @@ int __var_Create( vlc_object_t *p_this, const char *psz_name, int i_type )
vlc_mutex_unlock
(
&
p_priv
->
var_lock
);
/* We did not need to create a new variable, free everything... */
p_var
->
ops
->
pf_free
(
&
p_var
->
val
);
free
(
p_var
->
psz_name
);
if
(
p_var
->
choices
.
i_count
)
{
for
(
int
i
=
0
;
i
<
p_var
->
choices
.
i_count
;
i
++
)
{
p_var
->
ops
->
pf_free
(
&
p_var
->
choices
.
p_values
[
i
]
);
free
(
p_var
->
choices_text
.
p_values
[
i
].
psz_string
);
}
free
(
p_var
->
choices
.
p_values
);
free
(
p_var
->
choices_text
.
p_values
);
}
free
(
p_var
);
Destroy
(
p_var
);
return
VLC_SUCCESS
;
}
...
...
@@ -363,27 +370,6 @@ int __var_Destroy( vlc_object_t *p_this, const char *psz_name )
return
VLC_SUCCESS
;
}
/* Free value if needed */
p_var
->
ops
->
pf_free
(
&
p_var
->
val
);
/* Free choice list if needed */
if
(
p_var
->
choices
.
i_count
)
{
for
(
i
=
0
;
i
<
p_var
->
choices
.
i_count
;
i
++
)
{
p_var
->
ops
->
pf_free
(
&
p_var
->
choices
.
p_values
[
i
]
);
free
(
p_var
->
choices_text
.
p_values
[
i
].
psz_string
);
}
free
(
p_var
->
choices
.
p_values
);
free
(
p_var
->
choices_text
.
p_values
);
}
/* Free callbacks if needed */
free
(
p_var
->
p_entries
);
free
(
p_var
->
psz_name
);
free
(
p_var
->
psz_text
);
p_priv
->
i_vars
--
;
memmove
(
p_priv
->
pp_vars
+
i_var
,
p_priv
->
pp_vars
+
i_var
+
1
,
...
...
@@ -405,7 +391,7 @@ int __var_Destroy( vlc_object_t *p_this, const char *psz_name )
vlc_mutex_unlock
(
&
p_priv
->
var_lock
);
free
(
p_var
);
Destroy
(
p_var
);
return
VLC_SUCCESS
;
}
...
...
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