Re: gtk memory leaks



"Sreenidhi.B.G" <nidhi ncoretech com> writes:
I have been facing this problem with the memory leak. I have written a gtk
application that uses a text widget. The text manipulation takes place in a
function call. on repeated invocation of this function call the application
gets slow and finally crashes with error "Glib could not allocate x bytes".

I guess, the memory that has been allocated to text widget and the text (
string) is not getting freed and is still there in the heap even after my
function has exited. the data on the stack gets freed but what happens to the
one's on heap, is there a way ( an API ) for the programmer to free the memory
that has been allocated by gtk.


When a program exits, all memory from both stack and heap will be
freed.

I think you just have a memory leak of some kind, "could not allocate
x bytes" comes from running out of memory. Use a leak detection tool
such as memprof to detect the problem.

Havoc



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