Skip to content

Commit

Permalink
Revert "Remove image on buffer destroy callback only"
Browse files Browse the repository at this point in the history
This reverts commit cb6b86a.
  • Loading branch information
aperezdc committed Mar 25, 2024
1 parent 0b35394 commit b779595
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/view-backend-exportable-fdo-egl-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ struct wpe_fdo_egl_exported_image {
EGLImageKHR eglImage { nullptr };
uint32_t width { 0 };
uint32_t height { 0 };
bool exported { false };
struct wl_resource* bufferResource { nullptr };
struct wl_listener bufferDestroyListener;
};
5 changes: 3 additions & 2 deletions src/view-backend-exportable-fdo-egl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@ class ClientBundleEGL final : public ClientBundle {
{
if (image->bufferResource)
viewBackend->releaseBuffer(image->bufferResource);
else
deleteImage(image);
}

void releaseShmBuffer(struct wpe_fdo_shm_exported_buffer* buffer)
Expand All @@ -275,6 +277,7 @@ class ClientBundleEGL final : public ClientBundle {

void exportImage(struct wpe_fdo_egl_exported_image* image)
{
image->exported = true;
client->export_fdo_egl_image(data, image);
}

Expand All @@ -292,8 +295,6 @@ class ClientBundleEGL final : public ClientBundle {
image = wl_container_of(listener, image, bufferDestroyListener);

image->bufferResource = nullptr;

deleteImage(image);
}
};

Expand Down

0 comments on commit b779595

Please sign in to comment.