GNOME Bugzilla – Bug 790675
The gegl_operation_context_get_source method name is confusing
Last modified: 2017-11-26 11:48:06 UTC
The gegl_operation_context_get_source method is a thin wrapper around gegl_operation_context_get_object. Therefore it can be used to get both the input and output buffers, which doesn't match with the "source" in its name. Secondly, unlike most "get" methods it returns "transfer full", not "transfer none", which can cause reference counting bugs.
Created attachment 364135 [details] [review] operations/common/exp-combine: Don't leak the source buffers
Created attachment 364136 [details] [review] operation-context: Replace ambiguous method name
Created attachment 364137 [details] [review] operations/common/exp-combine: Don't leak the source buffers
commit 6e90b8d4db1ffcdaf389bfe825969fc2e565d957 Author: Øyvind Kolås <pippin@gimp.org> Date: Tue Nov 21 19:58:41 2017 +0100 operations/transform: s/_context_get_source/_context_dup_object/ commit 3206847c3f105f9732b0f9a23cbbe8315bcc57c8 Author: Øyvind Kolås <pippin@gimp.org> Date: Tue Nov 21 19:58:00 2017 +0100 operations/common-gpl3+: s/_context_get_source/_context_dup_object/ commit 05ce963169eb6d8799044b0c588d38e58c0118d6 Author: Øyvind Kolås <pippin@gimp.org> Date: Tue Nov 21 19:57:46 2017 +0100 operations/common: s/_context_get_source/_context_dup_object/ commit 9ba4e278fba0aa20e75e81919c11758a1fcbf3ae Author: Øyvind Kolås <pippin@gimp.org> Date: Tue Nov 21 19:57:36 2017 +0100 operations/core: s/_context_get_source/_context_dup_object/ commit a42ac5996cc55db9270a34349ccee04ac53997db Author: Øyvind Kolås <pippin@gimp.org> Date: Tue Nov 21 19:57:23 2017 +0100 gegl/operation: s/_context_get_source/_context_dup_object/ commit 8d362be8b1531b58aea9c57be9508989673e55dd Author: Debarshi Ray <debarshir@gnome.org> Date: Tue Nov 21 18:34:03 2017 +0100 operation-context: Replace ambiguous method name The gegl_operation_context_get_source method is misleading. It is a thin wrapper around gegl_operation_context_get_object. Therefore it can be used to get both the input and output buffers, which doesn't match with the "source" in its name. Secondly, unlike most "get" methods it returns "transfer full", not "transfer none", which can cause reference counting bugs. Address this by deprecating gegl_operation_context_get_source and adding a gegl_operation_context_dup_object method. https://bugzilla.gnome.org/show_bug.cgi?id=790675 commit 999f8ecbbc5a4f1ca3ccdb095589af0b2b711c75 Author: Debarshi Ray <debarshir@gnome.org> Date: Tue Nov 21 18:14:47 2017 +0100 operations/common/exp-combine: Don't leak the source buffers Contrary to its name, gegl_operation_context_get_source returns "transfer full", not "transfer none".
(In reply to Øyvind Kolås (pippin) from comment #4) ... > > commit a42ac5996cc55db9270a34349ccee04ac53997db > Author: Øyvind Kolås <pippin@gimp.org> > Date: Tue Nov 21 19:57:23 2017 +0100 > > gegl/operation: s/_context_get_source/_context_dup_object/ > ... This commit missed one _context_get_source occurrence here: https://git.gnome.org/browse/gegl/tree/gegl/operation/gegl-operation-point-filter.c#n124 and building GEGL there is a deprecation warning CC gegl-operation-point-filter.lo gegl-operation-point-filter.c: In function ‘gegl_operation_filter_process’: gegl-operation-point-filter.c:124:3: warning: ‘gegl_operation_context_get_source’ is deprecated [-Wdeprecated-declarations] input = gegl_operation_context_get_source (context, "input"); ^~~~~
commit d9248d1d7fafeb880c4fb08f4a6ba94fad458041 Author: Øyvind Kolås <pippin@gimp.org> Date: Sun Nov 26 12:42:53 2017 +0100 gegl: one more s/_context_get_source/_context_dup_object/