   boost::shared_ptr as member variable
  Hey guys,i'm working with g++, boost and Linux and am trying to get this running://conditioneditor.hclass ConditionEditor : public QWidget{Q_OBJECTpublic:ConditionEditor();void setText(QString text);QString text();private:QVBoxLayout *layout;boost::shared_ptr<int> ptr;QString m_text;};//conditioneditor.cppConditionEditor::ConditionEditor(): QWidget(),  layout(new QVBoxLayout(this)),  ptr(new int(5)),  m_text(""){}Forget about the Qt Stuff. Also the pointer type int is just an example here to make things easier. I get a segfault when executing this code.I get a segfault as long as i'm using a smart pointer as a member variable. It doesn't matter if it isn't initialized, or if it's initialized via MIL (as above) or via assignment.I don't get why I can't use the smart pointer as a member. If I put it into the constructor (which doesn't make sense for what I want), the code compiles and executes.Any ideas?EDIT: uhm, I still forgot another thing I tried. I made the smart pointer static. Then the program didn't crash anymore. Why that? The problem is that I don't want the variable to be static.   
  How are you using the object?Did you try it with just the smart pointer as a member, to be sure the problem is there?How, if at all, have you attempted to debug this so far?   ;  thx, Zahlman, for your reply.This is very odd. Today everything just works as expected. I will check my RAM tonight, there seems something to be broken at hardware level. My Computer also crashed today one time, what i am not used to.   