In DirectFB 1.4, DirectFB examples, there is a file call df_dok.c.
In its mian(), there is a "dest", can be created either as a Surface or as a SubSurface(to a Surface called Primary) under a switch "offscreen".
when the application exits by calling shutdown(), it will call dest->Release to deallocate back to memory pool.
Question:
If the "dest" is created as a subsurface, by default, it is, is it an issue or concern to call this dest->Release?
As created as a SubSurface, dest is sort of a child to Primary surface. As Primary got released first or later, the call of dest->release shall trigger a Error like: unmapping a non-mapped pointer?
I feel for a subsurface, we shall not call release on it. When its mother surface is released, then the subsurface will be naturally de-allocated.
If release a subsurface, then it will add complexity to the underlying another package/component to take good care of resource management.
Any comment is very appreciated.