-
Notifications
You must be signed in to change notification settings - Fork 8
Memeory_Leaks_Hunt
Alexis López Zubieta edited this page Mar 12, 2015
·
2 revisions
In this page are recorded tips about avoiding memory leaks learned while working with moonlightDE. First to all interest, read http://www.cprogramming.com/debugging/valgrind.html a nice post about leaks detection with valgrind.
While using gvfs functions that return non constant pointers you must always release then, by example:
QString m_Uri = g_file_get_uri(m_File);
Will result in a memory leak because the string returned is not freed, instead use:
char * uri = g_file_get_uri(m_File);
m_Uri = uri;
g_free(uri);