Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
76a07e86
Commit
76a07e86
authored
May 19, 2014
by
David Fuhrmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: addons manager: process the callback on the main thread
Avoids concurrent access to _addons and _displayedAddons.
parent
77fbebca
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
16 deletions
+19
-16
modules/gui/macosx/AddonManager.m
modules/gui/macosx/AddonManager.m
+19
-16
No files found.
modules/gui/macosx/AddonManager.m
View file @
76a07e86
...
...
@@ -34,19 +34,21 @@
NSArray
*
_displayedAddons
;
}
-
(
void
)
addAddon
:(
addon_entry_t
*
)
data
;
-
(
void
)
addAddon
:(
NSValue
*
)
o_value
;
-
(
void
)
discoveryEnded
;
-
(
void
)
addonChanged
:(
addon_entry_t
*
)
data
;
-
(
void
)
addonChanged
:(
NSValue
*
)
o_value
;
@end
static
void
addonsEventsCallback
(
const
vlc_event_t
*
event
,
void
*
data
)
{
if
(
event
->
type
==
vlc_AddonFound
)
[[
VLCAddonManager
sharedInstance
]
addAddon
:
event
->
u
.
addon_generic_event
.
p_entry
];
else
if
(
event
->
type
==
vlc_AddonsDiscoveryEnded
)
[[
VLCAddonManager
sharedInstance
]
discoveryEnded
];
else
if
(
event
->
type
==
vlc_AddonChanged
)
[[
VLCAddonManager
sharedInstance
]
addonChanged
:
event
->
u
.
addon_generic_event
.
p_entry
];
@autoreleasepool
{
if
(
event
->
type
==
vlc_AddonFound
)
[[
VLCAddonManager
sharedInstance
]
performSelectorOnMainThread
:
@selector
(
addAddon
:)
withObject
:
[
NSValue
valueWithPointer
:
event
->
u
.
addon_generic_event
.
p_entry
]
waitUntilDone
:
NO
];
else
if
(
event
->
type
==
vlc_AddonsDiscoveryEnded
)
[[
VLCAddonManager
sharedInstance
]
performSelectorOnMainThread
:
@selector
(
discoveryEnded
)
withObject
:
nil
waitUntilDone
:
NO
];
else
if
(
event
->
type
==
vlc_AddonChanged
)
[[
VLCAddonManager
sharedInstance
]
performSelectorOnMainThread
:
@selector
(
addonChanged
:)
withObject
:
[
NSValue
valueWithPointer
:
event
->
u
.
addon_generic_event
.
p_entry
]
waitUntilDone
:
NO
];
}
}
@implementation
VLCAddonManager
...
...
@@ -228,13 +230,12 @@ static VLCAddonManager *_o_sharedInstance = nil;
#pragma mark - data handling
-
(
void
)
addAddon
:(
addon_entry_t
*
)
p_entry
-
(
void
)
addAddon
:(
NSValue
*
)
o_value
{
@autoreleasepool
{
/* no skin support on OS X so far */
if
(
p_entry
->
e_type
!=
ADDON_SKIN2
)
[
_addons
addObject
:[[[
VLCAddon
alloc
]
initWithAddon
:
p_entry
]
autorelease
]];
}
addon_entry_t
*
p_entry
=
[
o_value
pointerValue
];
/* no skin support on OS X so far */
if
(
p_entry
->
e_type
!=
ADDON_SKIN2
)
[
_addons
addObject
:[[[
VLCAddon
alloc
]
initWithAddon
:
p_entry
]
autorelease
]];
}
-
(
void
)
discoveryEnded
...
...
@@ -243,7 +244,7 @@ static VLCAddonManager *_o_sharedInstance = nil;
[
_spinner
stopAnimation
:
nil
];
}
-
(
void
)
addonChanged
:(
addon_entry_t
*
)
data
-
(
void
)
addonChanged
:(
NSValue
*
)
o_value
{
[
self
_refactorDataModel
];
}
...
...
@@ -302,7 +303,9 @@ static VLCAddonManager *_o_sharedInstance = nil;
-
(
void
)
_findInstalled
{
addons_manager_LoadCatalog
(
_manager
);
[
self
_refactorDataModel
];
// enqueue, to process the addons first
[
self
performSelectorOnMainThread
:
@selector
(
_refactorDataModel
)
withObject
:
nil
waitUntilDone
:
NO
];
}
-
(
void
)
_installAddonWithID
:(
NSData
*
)
o_data
...
...
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