Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
77a64d9e
Commit
77a64d9e
authored
Aug 16, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Inline DeleteModule() and simplify
parent
c989a611
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
32 deletions
+14
-32
src/modules/modules.c
src/modules/modules.c
+14
-32
No files found.
src/modules/modules.c
View file @
77a64d9e
...
...
@@ -83,7 +83,6 @@ static int AllocatePluginFile( vlc_object_t *, module_bank_t *, const char *,
static
module_t
*
module_InitDynamic
(
vlc_object_t
*
,
const
char
*
,
bool
);
#endif
static
module_t
*
module_InitStatic
(
vlc_plugin_cb
);
static
void
DeleteModule
(
module_t
**
,
module_t
*
);
/**
* Init bank
...
...
@@ -144,7 +143,19 @@ void module_EndBank (bool b_plugins)
vlc_mutex_unlock
(
&
modules
.
lock
);
while
(
head
!=
NULL
)
DeleteModule
(
&
head
,
head
);
{
module_t
*
module
=
head
;
head
=
module
->
next
;
#ifdef HAVE_DYNAMIC_PLUGINS
if
(
module
->
b_loaded
&&
module
->
b_unloadable
)
{
module_Unload
(
module
->
handle
);
module
->
b_loaded
=
false
;
}
#endif
vlc_module_destroy
(
module
);
}
}
#undef module_LoadPlugins
...
...
@@ -906,7 +917,7 @@ static void AllocatePluginDir( vlc_object_t *p_this, module_bank_t *p_bank,
*****************************************************************************
* This function loads a dynamically loadable module and allocates a structure
* for its information data. The module can then be handled by module_need
* and module_unneed.
It can be removed by DeleteModule.
* and module_unneed.
*****************************************************************************/
static
int
AllocatePluginFile
(
vlc_object_t
*
p_this
,
module_bank_t
*
p_bank
,
const
char
*
path
,
const
struct
stat
*
st
,
...
...
@@ -961,7 +972,6 @@ static int AllocatePluginFile( vlc_object_t * p_this, module_bank_t *p_bank,
* Loads a dynamically-linked plug-in into memory and initialize it.
*
* The module can then be handled by module_need() and module_unneed().
* It can be removed by DeleteModule.
*
* \param path file path of the shared object
* \param fast whether to optimize loading for speed or safety
...
...
@@ -1030,31 +1040,3 @@ static module_t *module_InitStatic (vlc_plugin_cb entry)
return
module
;
}
/*****************************************************************************
* DeleteModule: delete a module and its structure.
*****************************************************************************
* This function can only be called if the module isn't being used.
*****************************************************************************/
static
void
DeleteModule
(
module_t
**
head
,
module_t
*
p_module
)
{
assert
(
p_module
);
assert
(
p_module
->
parent
==
NULL
);
/* Unlist the module (if it is in the list) */
module_t
**
pp_self
=
head
;
while
(
*
pp_self
!=
NULL
&&
*
pp_self
!=
p_module
)
pp_self
=
&
((
*
pp_self
)
->
next
);
if
(
*
pp_self
)
*
pp_self
=
p_module
->
next
;
/* We free the structures that we strdup()ed in Allocate*Module(). */
#ifdef HAVE_DYNAMIC_PLUGINS
if
(
p_module
->
b_loaded
&&
p_module
->
b_unloadable
)
{
module_Unload
(
p_module
->
handle
);
p_module
->
b_loaded
=
false
;
}
#endif
vlc_module_destroy
(
p_module
);
}
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