Re: Memory Leaks



Hi,

"Andrew Krause" <andrew openldev org> writes:

> I think this is more of a general C/C++ question, but I'll try
> here. My problem is that as my application runs longer, the memory
> usage slowly creeps up higher and higher. For example, if I call
> my Environment Settings dialog five times in a row, each time it
> uses more memory.
>
> Now this makes sense except that I am hiding the dialog and then
> using g_free() to free the memory that was allocated by the dialog
> after each hide.

Does that mean that your code boils down to something like the following?

 dialog = gtk_dialog_new ();
 gtk_widget_show (dialog);
 [...]
 gtk_widget_hide (dialog);
 g_free (dialog);

If that is the case, then I am not surprised. But I guess I just
misunderstood what you are doing. Perhaps you could make a small test
application that shows the problem?


Sven



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]