|
<< Click to Display Table of Contents >> Step 11: Free all resources |
![]() ![]()
|
After all desired operations have been performed, you need to clean up the resources allocated on behalf of the application. In addition to any memory explicitly allocated by the application, using malloc or new, all engine objects must also be cleaned up, including the cursor, database, and engine:
if (pRecBuf != NULL)
free(pRecBuf); // Free the record buffer
if (hCur != 0)
Chk(DbiCloseCursor(&hCur)); // Close the cursor
if (hDb != 0)
Chk(DbiCloseDatabase(&hDb)); // Close the database
DbiExit(); // Close the BDE.