Started by MoLAoS, 14 September 2014, 00:13:28
Quote from: texus on 14 September 2014, 00:29:23Your description is a bit vague. I don't see anything about the Tab class that should be crashing, so I assume you are talking about the get function from Gui in the tab example code?The get function returns a pointer to the widget, or nullptr when the widget isn't found. If you try to call a function on a nullptr it will crash of course. The only thing I can do about that is throw an exception instead of returning a nullptr, but that might not always be wanted.You should always be able to find a call stack somewhere when debugging. That usually gives enough information about where it happened. The last line might perhaps be in a tgui function with this=0x0 which can tell you that you called that function on a nullptr.But if you weren't talking about the get function then you will have to be a bit more specific than "The function".
Quotethis produces no callstack
QuoteIs that what you thought I should get before?
std::cout << gui.get("WrongName").get() << std::endl; // the last get() may or may not be needed to print the pointer
Quote from: texus on 14 September 2014, 11:11:22QuoteIs that what you thought I should get before?Yeah. I forgot that I was still using my own smart pointer in v0.6. That assertion is indeed what you get with v0.6.I can't debug it from here, that's why I need to have more information somehow.Just try using this code:Code Select Expandstd::cout << gui.get("WrongName").get() << std::endl; // the last get() may or may not be needed to print the pointerIf that prints something that looks like a null pointer, then I can't do anything and it works as expected.If that crashes, then could you upload your entire project including sfml and tgui libraries somewhere (e.g. dropbox) and send me the link? Then I may be able to test things myself here.