Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development
wrap char mode feature added for Editor Tweak plugin
ollydbg:
The reason why I check in a wrong function in rev 9382 is that originally I have code like:
--- Code: ---cbStyledTextCtrl* EditorTweaks::GetSafeControl()
{
cbEditor* ed = Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor();
if (!ed || m_isUpdatingUI)
return nullptr;
return ed->GetControl();
}
--- End code ---
After the testing by dmoore, I quickly blindly remove the m_isUpdatingUI check, thus error happens:
--- Code: ---cbStyledTextCtrl* EditorTweaks::GetSafeControl()
{
cbEditor* ed = Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor();
if (!ed)
return ed->GetControl();
}
--- End code ---
;D
MortenMacFly:
It is generally not safe to call SDK methods if the plugin is not attached (that's what the method IsAttached() is for). So the change in the two places should be fine.
ollydbg:
--- Quote from: MortenMacFly on October 07, 2013, 11:08:42 am ---It is generally not safe to call SDK methods if the plugin is not attached (that's what the method IsAttached() is for). So the change in the two places should be fine.
--- End quote ---
I'm curious that this bug should be already in trunk before rev 9382, since I don't change the control sequence in the rev 9382. Do you have a crash call stack? I'm curious which function cause this crash issue. :)
EDIT: I just test rev 9385 (before your fix), I have no crash here.
MortenMacFly:
--- Quote from: ollydbg on October 07, 2013, 11:26:09 am ---Do you have a crash call stack? I'm curious which function cause this crash issue. :)
--- End quote ---
Yes I had one but deleted it already. It was from PluginManager -> RegisterPlugin calling the plugins initialisation routine which caused an updateui event. this caused the illegal method call I had mentioned. Just trust me. :-)
Navigation
[0] Message Index
[*] Previous page
Go to full version