Page 1 of 1

Noesis::GUI::Init failing after Noesis::GUI::Shutdown

Posted: 01 Sep 2017, 10:38
by Jan
Hi,

we have successfully integrated Noesis into our project, but now we have problems with our Google Tests. Some of our tests start the whole engine and shut it down again. And then the next test, that wants to start the engine again fails with this error on Noesis::GUI::Init(NoesisErrorHandler) (all tests run on the same thread):

Already initialized - Gui\Core\Src\IntegrationAPI.cpp:60

The shutdown runs through without any problems. This is our uninit method:
void NoesisGuiLayer::uninitialize()
{		
        // Not sure if we need to explicitly unregister our components
	NsUnregisterComponent<EnscapeUiDescription::MiniMapControl>();
	NsUnregisterComponent<EnscapeUiDescription::MultiplyConverter>();
	NsUnregisterComponent<EnscapeUiDescription::RadToDegreeConverter>();
	m_mainDataContext.Reset();
	m_xamlView.Reset();
	m_glRenderDevice.Reset();
	Noesis::GUI::Shutdown();
}
Can someone give me a hint what the source of this problem might be? Are there more methods to call on shutdown which I might have missed?

Re: Noesis::GUI::Init failing after Noesis::GUI::Shutdown

Posted: 02 Sep 2017, 15:13
by jsantos
Init() and Shutdown() can only be called once. I recommend doing it as part of your testing framework initialization. The rest of objects (views, devices) can be created and destroyed accordingly.

Re: Noesis::GUI::Init failing after Noesis::GUI::Shutdown

Posted: 12 Sep 2017, 15:38
by Jan
Great! Thanks for the info. Fixed the problem.

Re: Noesis::GUI::Init failing after Noesis::GUI::Shutdown

Posted: 12 Sep 2017, 18:52
by jsantos
I have improved the documentation in IntegrationAPI.h to inform about this.

Marking this as solved! Thanks!