mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2024-11-27 12:14:10 +08:00
egl/haiku: fix double free of BBitmap
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30364>
(cherry picked from commit 2e70757dc0
)
This commit is contained in:
parent
1ac0f451d9
commit
86c5feed5c
@ -1464,7 +1464,7 @@
|
||||
"description": "egl/haiku: fix double free of BBitmap",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
@ -115,6 +115,9 @@ haiku_create_window_surface(_EGLDisplay *disp, _EGLConfig *conf,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Unset and delete previously set bitmap if any.
|
||||
delete ((BitmapHook *)native_window)->SetBitmap(NULL);
|
||||
|
||||
return &wgl_surf->base;
|
||||
}
|
||||
|
||||
@ -168,6 +171,13 @@ haiku_destroy_surface(_EGLDisplay *disp, _EGLSurface *surf)
|
||||
struct haiku_egl_surface *hgl_surf = haiku_egl_surface(surf);
|
||||
struct pipe_screen *screen = hgl_dpy->disp->fscreen->screen;
|
||||
screen->fence_reference(screen, &hgl_surf->throttle_fence, NULL);
|
||||
|
||||
// Unset bitmap to release ownership. Bitmap will be deleted later
|
||||
// when destroying framebuffer.
|
||||
BitmapHook *bitmapHook = (BitmapHook*)hgl_surf->fb->winsysContext;
|
||||
if (bitmapHook != NULL)
|
||||
bitmapHook->SetBitmap(NULL);
|
||||
|
||||
hgl_destroy_st_framebuffer(hgl_surf->fb);
|
||||
free(surf);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user