]> git.sesse.net Git - vlc/commitdiff
macosx: subscribe to libvlccore's debug messages only if the messages panel is actual...
authorFelix Paul Kühne <fkuehne@videolan.org>
Sun, 21 Apr 2013 21:36:44 +0000 (23:36 +0200)
committerFelix Paul Kühne <fkuehne@videolan.org>
Sun, 21 Apr 2013 21:36:44 +0000 (23:36 +0200)
This solves the empty console issue for builds running with debug messages enabled

modules/gui/macosx/intf.m

index 479027e6e65f6715c855ccbf2bd4b65e54e8cd44..92af38dc7849ed20bfa0285a3ab4afce269b01fb 100644 (file)
@@ -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)