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
68ed0898
Commit
68ed0898
authored
Mar 19, 2008
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input: Use a Destructor to delete critical resources. Destroy() should be removed.
parent
cae26885
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
src/input/input.c
src/input/input.c
+18
-0
No files found.
src/input/input.c
View file @
68ed0898
...
...
@@ -53,6 +53,8 @@
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static
void
Destructor
(
input_thread_t
*
p_input
);
static
int
Run
(
input_thread_t
*
p_input
);
static
int
RunAndDestroy
(
input_thread_t
*
p_input
);
...
...
@@ -281,9 +283,14 @@ static input_thread_t *Create( vlc_object_t *p_parent, input_item_t *p_item,
/* Attach only once we are ready */
vlc_object_attach
(
p_input
,
p_parent
);
/* Set the destructor when we are sure we are initialized */
vlc_object_set_destructor
(
p_input
,
(
vlc_destructor_t
)
Destructor
);
return
p_input
;
}
/* FIXME: This function should go away and only vlc_object_release()
* should be needed */
static
void
Destroy
(
input_thread_t
*
p_input
,
sout_instance_t
**
pp_sout
)
{
vlc_object_detach
(
p_input
);
...
...
@@ -298,10 +305,21 @@ static void Destroy( input_thread_t *p_input, sout_instance_t **pp_sout )
else
if
(
priv
->
b_sout_keep
)
SoutKeep
(
priv
->
p_sout
);
else
{
sout_DeleteInstance
(
priv
->
p_sout
);
priv
->
p_sout
=
NULL
;
}
}
vlc_object_release
(
p_input
);
}
/**
* Input destructor (called when the object's refcount reaches 0).
*/
static
void
Destructor
(
input_thread_t
*
p_input
)
{
input_thread_private_t
*
priv
=
p_input
->
p
;
vlc_mutex_destroy
(
&
priv
->
lock_control
);
free
(
priv
);
}
...
...
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