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
927f27d8
Commit
927f27d8
authored
Dec 17, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Save one memory copy and fix the helper module leak
parent
cbe2c267
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
17 deletions
+12
-17
include/vlc_modules_macros.h
include/vlc_modules_macros.h
+2
-6
src/config/core.c
src/config/core.c
+1
-11
src/modules/entry.c
src/modules/entry.c
+9
-0
No files found.
include/vlc_modules_macros.h
View file @
927f27d8
...
...
@@ -121,14 +121,10 @@ E_(vlc_entry) ( module_t *p_module );
#define vlc_module_end( ) \
} \
res = config_Duplicate( p_module, p_config, ++i_config ); \
free( p_config ); \
if (res) \
return res; \
return VLC_SUCCESS; \
return config_Duplicate( p_module, p_config, ++i_config ); \
\
error: \
free( p_config );
\
/* FIXME: config_Free( p_config ); */
\
/* FIXME: cleanup submodules objects ??? */
\
return VLC_EGENERIC; \
} \
...
...
src/config/core.c
View file @
927f27d8
...
...
@@ -492,9 +492,6 @@ int config_Duplicate( module_t *p_module, const module_config_t *p_orig,
const
module_config_t
*
p_item
,
*
p_end
=
p_orig
+
n
;
/* Calculate the structure length */
p_module
->
i_config_items
=
0
;
p_module
->
i_bool_items
=
0
;
for
(
p_item
=
p_orig
;
p_item
<
p_end
;
p_item
++
)
{
if
(
p_item
->
i_type
&
CONFIG_ITEM
)
...
...
@@ -508,19 +505,12 @@ int config_Duplicate( module_t *p_module, const module_config_t *p_orig,
}
}
/* Allocate memory */
p_module
->
p_config
=
(
module_config_t
*
)
calloc
(
n
,
sizeof
(
*
p_orig
)
);
if
(
p_module
->
p_config
==
NULL
)
{
msg_Err
(
p_module
,
"config error: can't duplicate p_config"
);
return
VLC_ENOMEM
;
}
p_module
->
p_config
=
p_orig
;
p_module
->
confsize
=
n
;
/* Do the duplication job */
for
(
size_t
i
=
0
;
i
<
n
;
i
++
)
{
p_module
->
p_config
[
i
]
=
p_orig
[
i
];
p_module
->
p_config
[
i
].
p_lock
=
&
p_module
->
object_lock
;
}
return
VLC_SUCCESS
;
...
...
src/modules/entry.c
View file @
927f27d8
...
...
@@ -40,6 +40,8 @@ module_t *vlc_module_create (vlc_object_t *obj)
module
->
psz_object_name
=
module
->
psz_longname
=
default_name
;
module
->
psz_capability
=
""
;
module
->
i_score
=
1
;
module
->
i_config_items
=
module
->
i_bool_items
=
0
;
return
module
;
}
...
...
@@ -161,6 +163,13 @@ module_config_t *vlc_config_create (module_t *module, int type)
tab
[
confsize
].
i_type
=
type
;
tab
[
confsize
].
p_lock
=
&
module
->
object_lock
;
if
(
type
&
CONFIG_ITEM
)
{
module
->
i_config_items
++
;
if
(
type
==
CONFIG_ITEM_BOOL
)
module
->
i_bool_items
++
;
}
return
tab
+
confsize
;
}
...
...
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