[vlc-commits] macosx: subscribe to libvlccore' s debug messages only if the messages panel is actually displayed
Felix Paul Kühne
git at videolan.org
Sun Apr 21 23:36:53 CEST 2013
vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Sun Apr 21 23:36:44 2013 +0200| [f07bd8cd815021e91219ec588190c8e723b7abdc] | committer: Felix Paul Kühne
macosx: subscribe to libvlccore's debug messages only if the messages panel is actually displayed
This solves the empty console issue for builds running with debug messages enabled
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f07bd8cd815021e91219ec588190c8e723b7abdc
---
modules/gui/macosx/intf.m | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index 479027e..92af38d 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -279,9 +279,6 @@ static void Run(intf_thread_t *p_intf)
[[VLCMain sharedInstance] setIntf: p_intf];
- /* subscribe to LibVLCCore's messages */
- vlc_LogSet(p_intf->p_libvlc, MsgCallback, NULL);
-
[NSBundle loadNibNamed: @"MainMenu" owner: NSApp];
[NSApp run];
@@ -1885,6 +1882,10 @@ static VLCMain *_o_sharedMainInstance = nil;
- (IBAction)showMessagesPanel:(id)sender
{
+ /* subscribe to LibVLCCore's messages */
+ vlc_LogSet(p_intf->p_libvlc, MsgCallback, NULL);
+
+ /* show panel */
[o_msgs_panel makeKeyAndOrderFront: sender];
}
@@ -1894,6 +1895,12 @@ static VLCMain *_o_sharedMainInstance = nil;
[o_msgs_table scrollRowToVisible: [o_msg_arr count] - 1];
}
+- (void)windowWillClose:(NSNotification *)o_notification
+{
+ /* unsubscribe from LibVLCCore's messages */
+ vlc_LogSet( p_intf->p_libvlc, NULL, NULL );
+}
+
- (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView
{
if (aTableView == o_msgs_table)
More information about the vlc-commits
mailing list