Hello, so I'm getting this wacky segfault that occurs in a seemingly unrelated part of my program to what I was working on. I ran it with GDB in the commandline and I'm honestly don't have any other tricks up my sleve, I don't know what the callstack implies, and I have no idea what any of it NEEDS to do. I also struggle with figuring out if what I have in the vector is valid. Any ideas for this kind of situation? The "events" are a stack of lambdas, which was the thing I was trying to implement as a temporary solution for something.
int main(){
UFO_EngineMain ufo;
ufo.scene_system.start_events.push_back([&](){ufo.scene_system.LoadScene<Scene>("../res/frogatto_jr/example.json"); return true;});
ufo.Start(1600,800,1,1);
return 0;
};
void SceneSystem::Start(){
if(scenes.size() > 0){
for(auto&& event : start_events) event();
scenes.back()->OnStart();
}
}
void
SceneSystem::GotoScene(std::string _scene_name){}
void
SceneSystem::RemoveActiveScene(){}
Scene*
SceneSystem::GetActiveScene(){
assert(scenes.size() > 0);
return scenes.back().get();
}
void
SceneSystem::Update(){
scenes[scenes.size()-1]->Update();
for(auto&& event : events){
event();
}
events.clear();
//scenes[scenes.size()-1]->DrawScene();
}