|
QMFree() |
|
|
The QMFree() function releases memory returned by other functions. It is only used with the C API library.
Format
void QMFree(void * addr)
where
Many of the C API functions return dynamically allocated memory. The QMFree() function allows a program to release this. The C runtime library free() function should not be used as it may not be compatible with the memory allocator used within the API functions.
Example
Rec = QMReadu(fClients, ClientNo, TRUE, ErrNo); Rec2 = QMReplace(Rec, 1, Pos, 0, NewData); QMWrite(fClients, ClientNo, Rec2); QMFree(Rec); QMFree(Rec2);
The above program fragment reads a record with an update lock, modifies it and then writes it back to the file. A real program should test the ErrNo status from the read operations to determine if they were successful. The QMFree() is used to release the dynamic memory allocated to store Rec and Rec2.
|