Re: [gtkmm] unexplained c++ pointer behaviour



On Wed, 2004-10-13 at 17:36, John Chronakis wrote:
> I am having a realy strange problem with a cpp class I am creating:
> 
> A mere declaration of any kind of pointer member variable causes 
> segmentation fault. I don't even use the pointer.
> 
> I have a working program with a typical class like the following:
> 
> class OwnThreadedWindow : public Gtk::Window, public Thread
> {
>     private:
>         int m_someint;
>         double m_somedouble;
>        .....
> 
>     protected:
>        virtual void run();
>        .....
>     public:
>        .....
> };
> 
> By just adding the line in "int * m_pi;" the programm compiles nicely 
> but causes a segmentation fault
> 
> class OwnThreadedWindow : public Gtk::Window, public Thread
> {
>     private:
>         int m_someint;
>         double m_somedouble;
>         .....
>         int * m_pi;
>     protected:
>         virtual void run();
>       .....
>     public:
>        .....
> };

I don't know about the threads issue, but the stupid guess would be that
you're not recompiling all the dependencies for OwnThreadedWindow, so
virtual function tables are screwed for outside client classes.  That
would affect the Gtk::run() bit, since you've derived from Gtk::*
classes.

Regards,
Carl




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