Wrong description of the API for gda_data_handler_get_default
Current documentation stays that GdaDataHandler
returned by gda_data_handler_get_default
must not be modified and freed. However, it causes a memory leak not to do so. Indeed, since the object is created using g_object_new
. The simple solution would be to use a common approach, e.g. g_object_unref
. It can be easily verified by using valgrind
for a simple program
#include <glib.h>
#include <libgda.h>
int main()
{
GdaDataHandler *dh;
gda_init ();
dh = gda_handler_string_new ();
g_object_unref (dh); // Will be memory leak if not called.
return 0;
}
We need to fix this leak in all calls of gda_data_handler_get_default()
. The documentation should be updated accordinly to reflect the correct usage of the API.
Edited by Pavlo Solntsev