Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to Dispose of Gegl Color
#1
I have a script that does some selects and cuts based on color.
   
Code:
image = pyi.file_load(r'/windows/projects/5150/Graphic Prefabs for Maps/geomorphs/hi-res/dead_parrot/legend/blank/4cb2d3ac-a815-4728-a8a1-0fac1e5e1e6f-018.png')
    color = Gegl.Color.new("black")

    layer = image.get_layers()[0]
    pyi.layer_add_alpha(layer)
    pyi.image_select_color(image, Gimp.ChannelOps.REPLACE, layer, color)
    pyi.gimp_selection_invert(layer)
    pyi.drawable_edit_clear(layer)
    pyi.image_resize(image, 7857, 6068)
   
    pyi.file_save(image, r'/windows/projects/5150/Graphic Prefabs for Maps/geomorphs/hi-res/dead_parrot/test/end.png')
    pyi.gimp_selection_none(image)
    pyi.image_delete(image)
    color.do_dispose()
    del color

    pyi.gimp_quit(False)

When run it either reports 1 or 2 leaked buffers. I have tried to dispose of the color item but have as yet been unsuccessful.  When run without any color creation like this, it runs with no buffer leaks.

Code:
    image = pyi.file_load(r'/windows/projects/5150/Graphic Prefabs for Maps/geomorphs/hi-res/dead_parrot/legend/blank/4cb2d3ac-a815-4728-a8a1-0fac1e5e1e6f-018.png')
    layer = image.get_layers()[0]
    pyi.layer_add_alpha(layer)   
    pyi.image_resize(image, 7857, 6068)  
    pyi.file_save(image, r'/windows/projects/5150/Graphic Prefabs for Maps/geomorphs/hi-res/dead_parrot/test/end.png')
    pyi.gimp_selection_none(image)
    pyi.image_delete(image)  
    pyi.gimp_quit(False)

  Hoping someone can help me find the problem.  Here's the output, this time it was just one leaked buffer but sometimes it is two:

Quote:Leaked buffer allocation stack trace:
/usr/local/lib64/libgegl-0.4.so.0(+0x4eefa) [0x7f1aac639efa]
/lib64/libgobject-2.0.so.0(g_type_create_instance+0x271) [0x7f1aac867af1]
/lib64/libgobject-2.0.so.0(+0x1d684) [0x7f1aac84b684]
/usr/local/lib64/libgegl-0.4.so.0(+0x4f2a8) [0x7f1aac63a2a8]
/lib64/libgobject-2.0.so.0(+0x1dc34) [0x7f1aac84bc34]
/lib64/libgobject-2.0.so.0(g_object_new_valist+0x1a7) [0x7f1aac84e0d7]
/lib64/libgobject-2.0.so.0(g_object_new+0x99) [0x7f1aac84e849]
/usr/local/lib64/libgegl-0.4.so.0(gegl_buffer_new+0x68) [0x7f1aac63ac78]
gimp(gimp_layer_add_alpha+0x86) [0x502c46]
gimp() [0x59edb7]
gimp(gimp_procedure_execute+0x1da) [0x6271ba]
gimp(gimp_pdb_execute_procedure_by_name_args+0x159) [0x623cb9]
gimp(gimp_plug_in_handle_message+0x63b) [0x63cc9b]
gimp() [0x62c496]
/lib64/libglib-2.0.so.0(+0x5f638) [0x7f1aac737638]
/lib64/libglib-2.0.so.0(+0x61398) [0x7f1aac739398]
/lib64/libglib-2.0.so.0(g_main_loop_run+0x77) [0x7f1aac739dc7]
gimp(gimp_plug_in_manager_call_run+0x6b1) [0x63e2a1]
gimp() [0x6323de]
gimp(gimp_procedure_execute+0x1da) [0x6271ba]
gimp(gimp_pdb_execute_procedure_by_name_args+0x159) [0x623cb9]
gimp(gimp_batch_run+0x1f5) [0x67b8c5]
gimp() [0x67757b]
/lib64/libgobject-2.0.so.0(g_closure_invoke+0x138) [0x7f1aac8458f8]
/lib64/libgobject-2.0.so.0(+0x2b5d3) [0x7f1aac8595d3]
/lib64/libgobject-2.0.so.0(+0x2cfe9) [0x7f1aac85afe9]
/lib64/libgobject-2.0.so.0(g_signal_emit_valist+0x32) [0x7f1aac860ad2]
/lib64/libgobject-2.0.so.0(g_signal_emit+0x8f) [0x7f1aac860b7f]
/lib64/libgio-2.0.so.0(+0xed0a0) [0x7f1aac4b00a0]
/lib64/libgio-2.0.so.0(g_application_run+0x107) [0x7f1aac4b0237]
gimp(app_run+0x1ea) [0x677aca]
gimp(main+0x365) [0x4bde55]
/lib64/libc.so.6(+0x2b12e) [0x7f1aab02b12e]
/lib64/libc.so.6(__libc_start_main+0x8b) [0x7f1aab02b1f9]
gimp(_start+0x25) [0x4bdfa5]

EEEEeEeek! 1 GeglBuffers leaked

Thanks in advance.
Reply


Messages In This Thread
How to Dispose of Gegl Color - by silenuznowan - 04-13-2025, 03:46 PM
RE: How to Dispose of Gegl Color - by Ofnuts - 04-13-2025, 07:14 PM

Forum Jump: