[Geany-Devel] Segmentation fault when auto-close plug-in is enable [patch]
thomas.martitz at xxxxx
Thu Oct 24 19:57:39 UTC 2013
Am 24.10.2013 16:25, schrieb Matthew Brush:
>> I agree with that.
>> I also agree with your general idea of per-document data lists. However,
>> I'm not seeing the point of the new code you added because each doc has
>> already a ScintillaObject, which is a GObject. I would suggest that the
>> document_set_data() and friends wrap around
>> g_object_set_data(doc->editor->sci). This way things are prepared for
>> when GeanyDocument becomes a GObject but without the need to duplicate
>> the glib interface in Geany.
>> Unless I missed anything that requires the datalist in GeanyDocument
> There isn't (or rather shouldn't be) a 1:1 correspondence between a
> GeanyDocument and the view that's showing it. Consider say a split
> view where the same document is shown in multiple views, or in two
> windows or whatever. But you're right, with the way the code is
> currently, you could just wrap the Scintilla data list, it's just not
> very future-proof (at least this was my thinking).
Yes, but that's an implementation detail (contained in ~15 lines of code
in document.c). For plugins and core it's the API you proposed either
way. Then, once GeanyDocument is a GObject, we can switch to its
datalist with little changes. Until then we use the ScintillaObjects.
Then we don't have to duplicate the glib code now.
More information about the Devel