ApCloseDBase()

Close a widget database

Synopsis:

#include <Ap.h>

int ApCloseDBase( ApDBase_t *db );

Arguments:

db
A pointer to a PhAB picture database structure, returned by ApOpenDBase() or ApOpenDBaseFile().

Library:

Ap

Description:

ApCloseDBase() closes a widget database that has been opened with ApOpenDBase() or ApOpenDBaseFile().

Closing a widget database deallocates its memory. If you're finished using a widget database, close it to free up the memory.


Note: If you use a widget database to create widgets that have PhImage_t data attached to them, don't close the database until those widgets are destroyed. Closing the database frees the memory used by the image. If you must close the database, make sure to copy the image data within your application code and to reset the image data resource to point to your new copy.

Returns:

0
Successful completion

Examples:

ApDBase_t       *mydbase;

mydbase = ApOpenDBase( ABM_mypicture );

ApCreateWidget( mydbase, "this_widget", 10, 10, 0, NULL );
ApCreateWidget( mydbase, "that_widget", 50, 10, 0, NULL );

ApCloseDBase( mydbase );

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

ApOpenDBase(), ApOpenDBaseFile(), PhImage_t

Accessing PhAB Modules from Code chapter of the Photon Programmer's Guide