FLTK logo

Re: Crash due to memory allocation?

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: Crash due to memory allocation? Stan Mar 29, 2007  
 
> > Iain Staffell wrote:

> MacArthur, Ian (SELEX) (UK) wrote:
> > You are creating your Pictar widget on the stack, and there is
> > insufficient stack space in your runtime environment to support that.
> >
> > Either increase you stack space (bad) or create the widget on the heap
> > by "new"ing it (good)...
>

>
> 	If you really want to be able to create the widget on the stack,
> 	then at least change the class so that img is a pointer that is
> 	dynamically allocated in the ctor with 'new' or 'malloc()',
> 	instead of as a hard coded array.


std::vector<double> would do the job for you.

Cheers,
Stan




Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.