Commit a270b32b authored by David Fuhrmann's avatar David Fuhrmann

macosx: lock access to addon_entry_t

parent 4a7e027c
......@@ -32,7 +32,7 @@
- (id)initWithAddon:(addon_entry_t *)p_entry;
- (uint8_t *)uuid;
- (NSData *)uuid;
- (NSString *)name;
- (NSString *)author;
......
......@@ -43,38 +43,66 @@
[super dealloc];
}
- (uint8_t *)uuid
- (NSData *)uuid
{
return p_addon_entry->uuid;
vlc_mutex_lock(&p_addon_entry->lock);
NSData *o_uuid = [NSData dataWithBytes:p_addon_entry->uuid length:sizeof(p_addon_entry->uuid)];
vlc_mutex_unlock(&p_addon_entry->lock);
return o_uuid;
}
- (NSString *)name
{
return toNSStr(p_addon_entry->psz_name);
vlc_mutex_lock(&p_addon_entry->lock);
NSString *o_str = toNSStr(p_addon_entry->psz_name);
vlc_mutex_unlock(&p_addon_entry->lock);
return o_str;
}
- (NSString *)author
{
return toNSStr(p_addon_entry->psz_author);
vlc_mutex_lock(&p_addon_entry->lock);
NSString *o_str = toNSStr(p_addon_entry->psz_author);
vlc_mutex_unlock(&p_addon_entry->lock);
return o_str;
}
- (NSString *)version
{
return toNSStr(p_addon_entry->psz_version);
vlc_mutex_lock(&p_addon_entry->lock);
NSString *o_str = toNSStr(p_addon_entry->psz_version);
vlc_mutex_unlock(&p_addon_entry->lock);
return o_str;
}
- (NSString *)description
{
return toNSStr(p_addon_entry->psz_description);
vlc_mutex_lock(&p_addon_entry->lock);
NSString *o_str = toNSStr(p_addon_entry->psz_description);
vlc_mutex_unlock(&p_addon_entry->lock);
return o_str;
}
- (BOOL)isInstalled
{
return p_addon_entry->e_state == ADDON_INSTALLED;
vlc_mutex_lock(&p_addon_entry->lock);
BOOL b_installed = p_addon_entry->e_state == ADDON_INSTALLED;
vlc_mutex_unlock(&p_addon_entry->lock);
return b_installed;
}
- (addon_type_t)type
{
return p_addon_entry->e_type;
vlc_mutex_lock(&p_addon_entry->lock);
addon_type_t type = p_addon_entry->e_type;
vlc_mutex_unlock(&p_addon_entry->lock);
return type;
}
@end
......@@ -276,14 +276,20 @@ static VLCAddonManager *_o_sharedInstance = nil;
addons_manager_LoadCatalog(_manager);
}
- (void)_installAddonWithID:(addon_uuid_t)addonid
- (void)_installAddonWithID:(NSData *)o_data
{
addons_manager_Install(_manager, addonid);
addon_uuid_t uuid;
[o_data getBytes:uuid length:sizeof(uuid)];
addons_manager_Install(_manager, uuid);
}
- (void)_removeAddonWithID:(addon_uuid_t)addonid
- (void)_removeAddonWithID:(NSData *)o_data
{
addons_manager_Remove(_manager, addonid);
addon_uuid_t uuid;
[o_data getBytes:uuid length:sizeof(uuid)];
addons_manager_Remove(_manager, uuid);
}
- (NSString *)_getAddonType:(int)i_type
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment