C++ class memory allocation error (getting Command terminated)

Hello!
I have a problem with the following code:
http://www.pastebay.com/101195

If I try to allocate memory on line 110 I get a start-up application crash. Application starts but closes just the next moment and I get a "Command terminated" error. I have tried the same class for a smaller application and everything works fine:
http://www.pastebay.com/101196

I don't think that this really matters at this point but as you will observe I use FLTK 2 API there.

Thank you for your help!

P.S. My OS is Linux.
P.P.S. I have tried to use Valgrind on my application and it says that I have some memory leaks (definitely). But I am not sure yet how to use Valgrind so here is the log:
http://www.pastebay.com/101209
Last edited on
What are those include icon lines in your code:

 
#include "icons/22x22/quit.xpm" 


That looks different...?
That is the way to use xpm image files.
Those are xpms used for the icons. I don't think that the problem is in them.
Ah, yes. A little investigation revealed that they are icons in c construct form.
OK! I got it! God, Valgrind is awesome.
First of all a was using xpmImage the wrong way. The right way is just static xpmImage image(xpm_file); . :-)
Second, this->size_range(); and this->show(); on lines 256-257 are wrong. Now I use them in main(), window_main->size_range() and window_main->show().
So, everything works now.
Last edited on
Topic archived. No new replies allowed.