robherring / gbm_gralloc

Android gralloc module using libgbm API from Mesa
20 stars 42 forks source link

Possible Error In gbm_mod_free_gpu0 #10

Open elliott-wen opened 6 years ago

elliott-wen commented 6 years ago

Just noticed a potential error in gbm_mod_free_gpu0

I suggested that we should use native_handle_delete rather than delete handle.

Because handle is allocated by malloc rather than "new"

static int gbm_mod_free_gpu0(alloc_device_t dev, buffer_handle_t handle) { struct gbm_module_t dmod = (struct gbm_module_t *) dev->common.module;

pthread_mutex_lock(&dmod->mutex);
gbm_free(handle);
native_handle_close(handle);
//delete handle;  
native_handle_delete(handle);
robherring commented 6 years ago

Indeed. Can you make a patch and send a PR.

elliott-wen commented 6 years ago

Sure. Will do it by today.

Cheers Elliott

On Tue, 3 Jul 2018 at 10:29, Rob Herring notifications@github.com wrote:

Indeed. Can you make a patch and send a PR.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/robherring/gbm_gralloc/issues/10#issuecomment-401956949, or mute the thread https://github.com/notifications/unsubscribe-auth/AFbxbIqFZBscnB_W-BkdTLTMwsrK1u4tks5uCp63gaJpZM4U-l0R .