gf_surface_free()

Free a surface

Synopsis:

#include <gf/gf.h>

void gf_surface_free( gf_surface_t surface );

Arguments:

psurface
The handle of the surface you want to free.

Library:

gf

Description:

This function frees a surface (gf_surface_t) created with gf_surface_create(), gf_surface_create_layer(), gf_surface_attach(), or gf_surface_attach_by_sid(). Call this only once you are done with a surface and no remaining contexts are targeting it. If the frame data buffer was allocated automatically, it also will be freed.


Note: When deallocating surfaces created with gf_surface_attach(), the frame data buffer won't be automatically freed. It's up to the application to free this memory at an appropriate time.

Because multiple processes may be using a surface attached via gf_surface_attach_by_sid(), this function will free the associated gf_surface_t, but not necessarily the frame data buffer. See gf_surface_attach_by_sid() for more information.

The gf_dev_detach() function automatically frees all associated surfaces.



WARNING: Threads should not call this function between calls to gf_draw_begin() and gf_draw_end(), or a deadlock will occur.

Classification:

QNX Graphics Framework

Safety:
Interrupt handler No
Signal handler No
Thread Yes

See also:

gf_surface_attach(), gf_surface_create(), gf_surface_create_layer()