Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

supagu

segmentation fault using new /w template?

This topic is 5426 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

here is my template im using: i extend from RegBase as i need to keep a list of ObjReg's... i also tried not making RegBase's Create not abstract, but it still causes a segmentaation fault :-/ class RegBase { public: virtual Obj* Create() = 0; }; template class ObjReg : public RegBase { public: ObjReg( std::string classId ) { ObjMgr::Register( classId, (RegBase*)this ); } Obj* Create() { return (new T); //return 0; } protected: }; *edit ops... the segemntation fault occus when i call Create() [edited by - supagu on February 8, 2004 5:38:03 AM]

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!