Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLCKit
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jean-Baptiste Kempf
VLCKit
Commits
9032a525
Commit
9032a525
authored
11 years ago
by
Felix Paul Kühne
Browse files
Options
Downloads
Patches
Plain Diff
VLCLibrary: take stricter care of our shared library instance
parent
66877e95
No related branches found
Branches containing commit
Tags
2.1-rc2
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Headers/Public/VLCLibrary.h
+0
-3
0 additions, 3 deletions
Headers/Public/VLCLibrary.h
Sources/VLCLibrary.m
+15
-3
15 additions, 3 deletions
Sources/VLCLibrary.m
with
15 additions
and
6 deletions
Headers/Public/VLCLibrary.h
+
0
−
3
View file @
9032a525
...
...
@@ -39,9 +39,6 @@
* instiantiation of VLCLibrary, as previously noted, this is done automatically by the dynamic link loader.
*/
@interface
VLCLibrary
:
NSObject
{
void
*
instance
;
}
/* Factories */
/**
...
...
This diff is collapsed.
Click to expand it.
Sources/VLCLibrary.m
+
15
−
3
View file @
9032a525
...
...
@@ -37,6 +37,14 @@
#include
<vlc/libvlc_structures.h>
static
VLCLibrary
*
sharedLibrary
=
nil
;
static
void
*
sharedInstance
=
nil
;
@interface
VLCLibrary
()
{
void
*
instance
;
}
@end
@implementation
VLCLibrary
+
(
VLCLibrary
*
)
sharedLibrary
...
...
@@ -44,6 +52,7 @@ static VLCLibrary * sharedLibrary = nil;
if
(
!
sharedLibrary
)
{
/* Initialize a shared instance */
sharedLibrary
=
[[
self
alloc
]
init
];
sharedInstance
=
sharedLibrary
.
instance
;
}
return
sharedLibrary
;
}
...
...
@@ -166,8 +175,11 @@ static VLCLibrary * sharedLibrary = nil;
if
(
instance
)
libvlc_release
(
instance
);
if
(
self
==
sharedLibrary
)
if
(
self
==
sharedLibrary
)
{
sharedLibrary
=
nil
;
libvlc_release
(
sharedInstance
);
sharedInstance
=
nil
;
}
[
super
dealloc
];
}
...
...
@@ -177,9 +189,9 @@ static VLCLibrary * sharedLibrary = nil;
@implementation
VLCLibrary
(
VLCLibVLCBridging
)
+
(
void
*
)
sharedInstance
{
NSAssert
(
[
self
sharedLibrary
].
i
nstance
,
@"shared library doesn't have an instance"
);
NSAssert
(
sharedI
nstance
,
@"shared library doesn't have an instance"
);
return
[
self
sharedLibrary
].
i
nstance
;
return
sharedI
nstance
;
}
-
(
void
*
)
instance
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment