Hydra for delphi: wpf visual plugin memory issue and access violation

In our c++builder application we are trying to use a wpf HyVisualPlugin. Nonvisualplugins work fine, but this visualplugin:

1/ consumes lots of memory
2/ crashes on the forth use with an access violation in XXXXXXXXXXXXXXXX

Any clues what we’re doing wrong:

Upon Application start we load de plugins:

mm = new Uhymodulemanager::THYModuleManager(NULL);
mm->LoadModule(ExtractFilePath(Application->ExeName) + "hyVisualControls.dll", false);

Afterwards when we need to display the plugin we have a wrapper function:

_di_IHyVisualControls ivcTest;
int __fastcall ThyCommon::PDFViewer(System::UnicodeString str_FileName, TPanel* pnl_PDF, short ShowBar)
{
	if (ivcTest == NULL)
	{
		dtm_HydraModule->mm->CreateVisualPlugin("HyVisualControls.Plugin1", dtm_HydraModule->hyVisualControls, pnl_PDF);
		ivcTest = (_di_IHyVisualControls)dtm_HydraModule->hyVisualControls;
	}
	else
	{
		dtm_HydraModule->hyVisualControls->ShowParented(pnl_PDF);
	}

	ivcTest->PdfViewer(str_FileName, ShowBar);
}

Code runs fine, once trough createvisualplugin… twice trough ShowParented, third time i don’t reach my breakpoint in PDVViewer, but get an access violation in uHYCLRManagedPluginWrappers, function THYManagedWrapper.QueryInterface(const IID: TGUID; out Obj): HResult; on line:

result := fManagedInstance.QueryInterface(IID, Obj);

any ideas would be greatly appreciated!

nevermind… problem fixed

Hello

Could you describe what was caused this issue?