Page 1 of 1

Crash on button click in plugin dll

Posted: 15 May 2014, 19:44
by noesis_user
Hello,
We have a plugin architecture for that we are adding plugin xaml root to mainwindow xaml. The plugin root is sent to plugin dll to access its components and events.

At core side:
Noesis::Gui::FrameworkElement* main_root = (Noesis::Gui::FrameworkElement*)(mUIRoot);

Noesis::Core::Ptr<Noesis::Gui::FrameworkElement> root =
            Noesis::Gui::LoadXaml<Noesis::Gui::FrameworkElement>(xaml_filename.c_str());

 panel->GetChildren()->Add((Noesis::Core::BaseComponent*) root.GetPtr());
   
renderFrame();

//Passing plugin xaml root to plugin dll
_plugin->setGuiRoot((Noesis::Core::BaseComponent*) root.GetPtr());
At Plugin dll:
Noesis::Gui::FrameworkElement* p1_root = (Noesis::Gui::FrameworkElement*)root_;
      
  Noesis::Gui::RadioButton* expand_patient_list_button = NsStaticCast<RadioButton*>
  (p1_root>FindName("RadioExpandCaseLoader"));

 expand_patient_list_button->Click() += MakeDelegate(this,&SetCaseLoaderGui::OnExpandPatientListButtonClicked);
Now it gets valid button pointer n all but when we click on that it crashes in MouseButtonUp event in Noesis.dll (renderer). What could lead this crash?

Thanks.

Re: Crash on button click in plugin dll

Posted: 16 May 2014, 21:12
by sfernandez
I don't see anything wrong in your code.
Could you please provide a bit more information? What kind of crash are you getting? Could you attach a crash dump?

Re: Crash on button click in plugin dll

Posted: 20 May 2014, 11:30
by sfernandez
Have you managed to reproduce this issue again?
Can you provide a sample so we can fix it?

Re: Crash on button click in plugin dll

Posted: 23 May 2014, 18:07
by noesis_user
Fixed this !!

Plugin object was getting destroyed before it could use it so was the crash.