Skip to content

Commit

Permalink
Remove image on buffer destroy callback only
Browse files Browse the repository at this point in the history
view-backend-exportable-fdo-egl.cpp relies on the
bufferDestroyListenerCallback for destroying the image, This is called
during the wl_resource_destroy() to release the image.

Related-to: #175 #176
  • Loading branch information
psaavedra authored and aperezdc committed Feb 16, 2023
1 parent 2c6a7d2 commit cb6b86a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/view-backend-exportable-fdo-egl-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ 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: 2 additions & 3 deletions src/view-backend-exportable-fdo-egl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,6 @@ 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 @@ -277,7 +275,6 @@ 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 @@ -295,6 +292,8 @@ class ClientBundleEGL final : public ClientBundle {
image = wl_container_of(listener, image, bufferDestroyListener);

image->bufferResource = nullptr;

deleteImage(image);
}
};

Expand Down

0 comments on commit cb6b86a

Please sign in to comment.