Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
3788f1cb
Commit
3788f1cb
authored
Nov 11, 2014
by
David Fuhrmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: fix memleaks in podcast handling, remove unnecessary module restart
parent
5657ce1d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
modules/gui/macosx/MainWindow.m
modules/gui/macosx/MainWindow.m
+13
-8
No files found.
modules/gui/macosx/MainWindow.m
View file @
3788f1cb
...
...
@@ -1279,11 +1279,13 @@ static VLCMainWindow *_o_sharedInstance = nil;
-
(
IBAction
)
removePodcast
:(
id
)
sender
{
if
(
config_GetPsz
(
VLCIntf
,
"podcast-urls"
)
!=
NULL
)
{
char
*
psz_urls
=
var_InheritString
(
pl_Get
(
VLCIntf
),
"podcast-urls"
);
if
(
psz_urls
!=
NULL
)
{
[
o_podcast_unsubscribe_pop
removeAllItems
];
[
o_podcast_unsubscribe_pop
addItemsWithTitles
:[
[
NSString
stringWithUTF8String
:
config_GetPsz
(
VLCIntf
,
"podcast-urls"
)]
componentsSeparatedByString
:
@"|"
]];
[
o_podcast_unsubscribe_pop
addItemsWithTitles
:[
toNSStr
(
psz_urls
)
componentsSeparatedByString
:
@"|"
]];
[
NSApp
beginSheet
:
o_podcast_unsubscribe_window
modalForWindow
:
self
modalDelegate
:
self
didEndSelector
:
NULL
contextInfo
:
nil
];
}
free
(
psz_urls
);
}
-
(
IBAction
)
removePodcastWindowAction
:(
id
)
sender
...
...
@@ -1292,17 +1294,20 @@ static VLCMainWindow *_o_sharedInstance = nil;
[
NSApp
endSheet
:
o_podcast_unsubscribe_window
];
if
(
sender
==
o_podcast_unsubscribe_ok_btn
)
{
playlist_t
*
p_playlist
=
pl_Get
(
VLCIntf
);
char
*
psz_urls
=
var_InheritString
(
p_playlist
,
"podcast-urls"
);
NSMutableArray
*
urls
=
[[
NSMutableArray
alloc
]
initWithArray
:[[
NSString
stringWithUTF8String
:
config_GetPsz
(
VLCIntf
,
"podcast-urls"
)]
componentsSeparatedByString
:
@"|"
]];
[
urls
removeObjectAtIndex
:
[
o_podcast_unsubscribe_pop
indexOfSelectedItem
]];
config_PutPsz
(
VLCIntf
,
"podcast-urls"
,
[[
urls
componentsJoinedByString
:
@"|"
]
UTF8String
]);
var_SetString
(
pl_Get
(
VLCIntf
),
"podcast-urls"
,
config_GetPsz
(
VLCIntf
,
"podcast-urls"
));
const
char
*
psz_new_urls
=
[[
urls
componentsJoinedByString
:
@"|"
]
UTF8String
];
var_SetString
(
pl_Get
(
VLCIntf
),
"podcast-urls"
,
psz_new_urls
);
config_PutPsz
(
VLCIntf
,
"podcast-urls"
,
psz_new_urls
);
[
urls
release
];
/* reload the podcast module, since it won't update its list when removing podcasts */
playlist_t
*
p_playlist
=
pl_Get
(
VLCIntf
);
free
(
psz_urls
);
/* update playlist table */
if
(
playlist_IsServicesDiscoveryLoaded
(
p_playlist
,
"podcast{longname=
\"
Podcasts
\"
}"
))
{
playlist_ServicesDiscoveryRemove
(
p_playlist
,
"podcast{longname=
\"
Podcasts
\"
}"
);
playlist_ServicesDiscoveryAdd
(
p_playlist
,
"podcast{longname=
\"
Podcasts
\"
}"
);
[[[
VLCMain
sharedInstance
]
playlist
]
playlistUpdated
];
}
}
...
...
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