Commit f07bd8cd authored by Felix Paul Kühne's avatar 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
parent e2b3a9bf
......@@ -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)
......
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