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
a4e90800
Commit
a4e90800
authored
Mar 19, 2008
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vlm: Fix destruction by using correctly using refcounting.
parent
4af174fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
17 deletions
+10
-17
src/input/vlm.c
src/input/vlm.c
+10
-17
No files found.
src/input/vlm.c
View file @
a4e90800
...
...
@@ -66,6 +66,8 @@
* even if we handle NULL format string in vlm_MessageNew() */
static
const
char
*
vlm_NULL
=
NULL
;
static
void
vlm_Destructor
(
vlm_t
*
p_vlm
);
/* */
static
int
vlm_ControlInternal
(
vlm_t
*
,
int
,
...
);
...
...
@@ -130,7 +132,6 @@ vlm_t *__vlm_New ( vlc_object_t *p_this )
TAB_INIT
(
p_vlm
->
i_schedule
,
p_vlm
->
schedule
);
p_vlm
->
i_vod
=
0
;
p_vlm
->
p_vod
=
NULL
;
vlc_object_yield
(
p_vlm
);
vlc_object_attach
(
p_vlm
,
p_this
->
p_libvlc
);
if
(
vlc_thread_create
(
p_vlm
,
"vlm thread"
,
...
...
@@ -162,6 +163,7 @@ vlm_t *__vlm_New ( vlc_object_t *p_this )
}
free
(
psz_vlmconf
);
vlc_object_set_destructor
(
p_vlm
,
(
vlc_destructor_t
)
vlm_Destructor
);
vlc_mutex_unlock
(
lockval
.
p_address
);
return
p_vlm
;
...
...
@@ -172,24 +174,18 @@ vlm_t *__vlm_New ( vlc_object_t *p_this )
*****************************************************************************/
void
vlm_Delete
(
vlm_t
*
p_vlm
)
{
vlc_value_t
lockval
;
var_Get
(
p_vlm
->
p_libvlc
,
"vlm_mutex"
,
&
lockval
);
vlc_mutex_lock
(
lockval
.
p_address
);
vlc_object_detach
(
p_vlm
);
vlc_object_release
(
p_vlm
);
}
if
(
p_vlm
->
p_internals
->
i_refcount
>
0
)
{
vlc_mutex_unlock
(
lockval
.
p_address
);
return
;
}
/*****************************************************************************
* vlm_Destructor:
*****************************************************************************/
static
void
vlm_Destructor
(
vlm_t
*
p_vlm
)
{
vlc_object_kill
(
p_vlm
);
vlc_thread_join
(
p_vlm
);
vlc_object_detach
(
p_vlm
);
vlm_ControlInternal
(
p_vlm
,
VLM_CLEAR_MEDIAS
);
TAB_CLEAN
(
p_vlm
->
i_media
,
p_vlm
->
media
);
...
...
@@ -197,9 +193,6 @@ void vlm_Delete( vlm_t *p_vlm )
TAB_CLEAN
(
p_vlm
->
schedule
,
p_vlm
->
schedule
);
vlc_mutex_destroy
(
&
p_vlm
->
lock
);
vlc_object_release
(
p_vlm
);
vlc_mutex_unlock
(
lockval
.
p_address
);
}
/*****************************************************************************
...
...
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