Commit 5b3cb0eb authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

display: remove explicit window deletions

Now that the video splitter also creates windows up-front and keeps
them, there is no point in deleting windows explicitly when a display
fails initialization or is destroyed.
parent 56de48d1
......@@ -441,7 +441,6 @@ static int Open(vlc_object_t *obj)
{
msg_Dbg(obj, "device creation failure: error %d", (int)err);
xcb_disconnect(sys->conn);
vout_display_DeleteWindow(vd, sys->embed);
free(sys);
return VLC_EGENERIC;
}
......@@ -661,7 +660,6 @@ static int Open(vlc_object_t *obj)
error:
vdp_release_x11(sys->vdp);
xcb_disconnect(sys->conn);
vout_display_DeleteWindow(vd, sys->embed);
free(sys);
return VLC_EGENERIC;
}
......@@ -679,6 +677,5 @@ static void Close(vlc_object_t *obj)
vdp_release_x11(sys->vdp);
xcb_disconnect(sys->conn);
vout_display_DeleteWindow(vd, sys->embed);
free(sys);
}
......@@ -525,17 +525,13 @@ static int OpenCommon(vout_display_t *vd)
{
/* It's better to use gles2 if we are not able to change the video
* layout */
vout_display_DeleteWindow(vd, embed);
return VLC_EGENERIC;
}
/* Allocate structure */
vd->sys = sys = (struct vout_display_sys_t*)calloc(1, sizeof(*sys));
if (!sys)
{
vout_display_DeleteWindow(vd, embed);
return VLC_ENOMEM;
}
sys->embed = embed;
sys->p_awh = p_awh;
......@@ -719,10 +715,7 @@ static void Close(vlc_object_t *p_this)
AndroidWindow_Destroy(vd, sys->p_sub_window);
if (sys->embed)
{
AWindowHandler_setVideoLayout(sys->p_awh, 0, 0, 0, 0, 0, 0);
vout_display_DeleteWindow(vd, sys->embed);
}
free(sys);
}
......
......@@ -249,9 +249,6 @@ static void Close (vlc_object_t *p_this)
if (sys->container)
[sys->container release];
if (sys->embed)
vout_display_DeleteWindow(vd, sys->embed);
if (sys->vgl != NULL && !OpenglLock(sys->gl)) {
vout_display_opengl_Delete(sys->vgl);
OpenglUnlock(sys->gl);
......
......@@ -302,8 +302,6 @@ exit_kva_init :
WinDestroyWindow( sys->frame );
exit_frame :
vout_display_DeleteWindow( vd, sys->parent_window );
if( sys->is_mouse_hidden )
WinShowPointer( HWND_DESKTOP, TRUE );
......
......@@ -300,8 +300,6 @@ void Close (vlc_object_t *this)
[sys->glView release];
if (sys->embed)
vout_display_DeleteWindow (vd, sys->embed);
free (sys);
}
}
......
......@@ -162,8 +162,6 @@ static int Open (vlc_object_t *obj)
error:
if (sys->gl != NULL)
vlc_gl_Release (sys->gl);
if (surface != NULL)
vout_display_DeleteWindow (vd, surface);
free (sys);
return VLC_EGENERIC;
}
......@@ -176,14 +174,12 @@ static void Close (vlc_object_t *obj)
vout_display_t *vd = (vout_display_t *)obj;
vout_display_sys_t *sys = vd->sys;
vlc_gl_t *gl = sys->gl;
vout_window_t *surface = gl->surface;
vlc_gl_MakeCurrent (gl);
vout_display_opengl_Delete (sys->vgl);
vlc_gl_ReleaseCurrent (gl);
vlc_gl_Release (gl);
vout_display_DeleteWindow (vd, surface);
free (sys);
}
......
......@@ -482,8 +482,6 @@ static int Open(vlc_object_t *obj)
error:
if (sys->eventq != NULL)
wl_event_queue_destroy(sys->eventq);
if (sys->embed != NULL)
vout_display_DeleteWindow(vd, sys->embed);
free(sys);
return VLC_EGENERIC;
}
......@@ -502,7 +500,6 @@ static void Close(vlc_object_t *obj)
wl_shm_destroy(sys->shm);
wl_display_flush(sys->embed->display.wl);
wl_event_queue_destroy(sys->eventq);
vout_display_DeleteWindow(vd, sys->embed);
free(sys);
}
......
......@@ -884,10 +884,6 @@ static void Win32VoutCloseWindow( event_thread_t *p_event )
if( p_event->hfswnd )
DestroyWindow( p_event->hfswnd );
#if defined(MODULE_NAME_IS_direct3d9) || defined(MODULE_NAME_IS_direct3d11)
if( !p_event->use_desktop )
#endif
vout_display_DeleteWindow( vd, p_event->parent_window );
p_event->hwnd = NULL;
HINSTANCE hInstance = GetModuleHandle(NULL);
......
......@@ -136,7 +136,6 @@ vout_window_t *vlc_xcb_parent_Create(vout_display_t *vd,
error:
if (conn != NULL)
xcb_disconnect (conn);
vout_display_DeleteWindow (vd, wnd);
return NULL;
}
......
......@@ -325,7 +325,6 @@ static void Close (vlc_object_t *obj)
/* colormap, window and context are garbage-collected by X */
xcb_disconnect (sys->conn);
vout_display_DeleteWindow (vd, sys->embed);
free (sys);
}
......
......@@ -588,7 +588,6 @@ static void Close (vlc_object_t *obj)
free (p_sys->att);
xcb_disconnect (p_sys->conn);
vout_display_DeleteWindow (vd, p_sys->embed);
free (p_sys);
}
......
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