Close a widget database
#include <Ap.h> int ApCloseDBase( ApDBase_t *db );
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.
|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.|
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 );
ApOpenDBase(), ApOpenDBaseFile(), PhImage_t
Accessing PhAB Modules from Code chapter of the Photon Programmer's Guide