[Plugin] Myo

Hello again !

I’ve spotted another problem : once packaged, my game crashed on startup. So I tried debugging the exe through VisualStudio (in DebugGame configuration), and there’s an unhandled exception thrown here :

File : Hub_impl.hpp


Hub::Hub(const std::string& applicationIdentifier)
: _hub(0)
, _myos()
, _listeners()
{
	libmyo_error_details_t _error;
	libmyo_init_hub(&_hub, applicationIdentifier.c_str(), &_error);

	switch (**libmyo_error_kind(_error)**) {
		case libmyo_error:
		case libmyo_error_runtime:
		case libmyo_error_invalid_argument:
		{
			lastInitCausedError = true;
			break;
		}
		case libmyo_success:
		{
			lastInitCausedError = false;
			break;
		}
	}
}

It turns out libmyo_init_hub, even through returning libmyo_success, was leaving _error uninitialized, quite strange…From there I added a check to know if the function executed successfully and now the packaged game works like a charm !



	libmyo_result_t res = libmyo_init_hub(&_hub, applicationIdentifier.c_str(), &_error);
	
	if (res == libmyo_success) {
		lastInitCausedError = false;
	}
	else {
		switch (libmyo_error_kind(_error)) {
                        /* ... */
		}
	}

When searching about the issue I stumbled upon topic where you discussed part of the code. I suppose we should notify Thalmic devs about as they seem unaware of it.

About my previous issue (compiling a blueprint with a MyoComponent causes UE Editor to crash), I managed to compile after quitting MyoConnect. I can then restart MyoConnect and it works as intended. But if I try to recompile or even move the blueprint instance in the level, the crash comes back. My log file ends abruplty after quite a struggle it seems :

I don’t know if it’s possible to debug a crash in the Editor, so I’m a little stuck. I’ll see want I can do !