/* Ugly, but the Qt4 interface assumes single instance anyway */
static vlc_sem_t ready;
+#ifdef Q_WS_X11
+static char *x11_display = NULL;
+#endif
/*****************************************************************************
* Module callbacks
intf_thread_t *p_intf = (intf_thread_t *)p_this;
#ifdef Q_WS_X11
- char *psz_display = var_CreateGetNonEmptyString( p_intf, "x11-display" );
- Display *p_display = XOpenDisplay( psz_display );
- free( psz_display );
+ x11_display = var_CreateGetNonEmptyString( p_intf, "x11-display" );
+ Display *p_display = XOpenDisplay( x11_display );
if( !p_display )
{
msg_Err( p_intf, "Could not connect to X server" );
vlc_join (p_sys->thread, NULL);
pl_Release (p_this);
delete p_sys;
+#ifdef Q_WS_X11
+ free (x11_display);
+#endif
}
static void *Thread( void *obj )
/* Start the QApplication here */
#ifdef Q_WS_X11
- char *display = var_CreateGetNonEmptyString( p_intf, "x11-display" );
- if( display )
+ if( x11_display != NULL )
{
argv[argc++] = const_cast<char *>("-display");
- argv[argc++] = display;
+ argv[argc++] = x11_display;
argv[argc] = NULL;
}
#endif
/* Delete the application automatically */
#ifdef Q_WS_X11
- free( display );
+ free( x11_display );
#endif
return NULL;
}
p_wnd->xid = p_mi->getVideo( &i_x, &i_y, &i_width, &i_height );
if( !p_wnd->xid )
return VLC_EGENERIC;
+ p_wnd->x11_display = x11_display;
#elif defined (Q_WS_WIN)
p_wnd->hwnd = p_mi->getVideo( &i_x, &i_y, &i_width, &i_height );