static int gralloc_device_close(struct hw_device_t *dev)
{
    gralloc_device_t* d = reinterpret_cast<gralloc_device_t*>(dev);
    if (d) {

        // free still allocated buffers
        while( d->allocListHead != NULL ) {
            gralloc_free(&d->device, d->allocListHead->handle);
        }

        // free device
        free(d);
    }
    return 0;
}
Esempio n. 2
0
gralloc_device_t::~gralloc_device_t() {
  for (buffer_list_t::iterator it = list.begin(); it != list.end(); ++it) {
    gralloc_free(&device, *it);
  }
  pthread_mutex_destroy(&lock);
}