Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Application crashes when custom_series being deleted from a callback #1864

Closed
sedenka opened this issue Aug 19, 2022 · 3 comments
Closed

Application crashes when custom_series being deleted from a callback #1864

sedenka opened this issue Aug 19, 2022 · 3 comments
Labels
priority: high high priority state: ready Fixed/Added and will be present in an upcoming release type: bug bug

Comments

@sedenka
Copy link

sedenka commented Aug 19, 2022

Version of Dear PyGui

Version: 1.6.2
Operating System: Windows 10

My Issue/Question

The code below crashes when I am trying to delete custom_series from a callback using parent item or tag. The code crashes only when the custom_series is visible (if you use dpg.add_custom_series(..., show=False), the application will not crash).

To Reproduce

Steps to reproduce the behavior:

  1. Click on the first button (application crashes)
  2. Click on the second button (application crashes)
  3. Check the command line output and the code (immediately deleting works as expected)

Expected behavior

Removal of the item from a callback should be possible without the crash.

Standalone, minimal, complete and verifiable example

import dearpygui.dearpygui as dpg

dpg.create_context()
dpg.create_viewport(width=300, height=200)
dpg.setup_dearpygui()

with dpg.window(label="Example Window", tag="Primary"):
    dpg.add_button(label="delete custom_series using parent", callback=lambda: dpg.delete_item("win", children_only=True))
    dpg.add_button(label="delete custom_series using tag", callback=lambda: dpg.delete_item("tricky_custom_series"))
    with dpg.child_window(tag="win"):
        with dpg.plot(width=-1, height=-1):
            dpg.add_plot_axis(dpg.mvXAxis)
            with dpg.plot_axis(dpg.mvYAxis) as yaxis:
                dpg.add_custom_series([], [], 2, tag="tricky_custom_series")
                print(f"Before delete_item(): {dpg.get_item_children(yaxis, 1)}")
                dpg.delete_item("tricky_custom_series")
                print(f"After delete_item(): {dpg.get_item_children(yaxis, 1)}")
                dpg.add_custom_series([], [], 2, tag="tricky_custom_series")
                print(f"After add_custom_series(): {dpg.get_item_children(yaxis, 1)}")
 
dpg.show_viewport()
dpg.set_primary_window("Primary", True)
dpg.start_dearpygui()
dpg.destroy_context()
@sedenka sedenka added state: pending not addressed yet type: bug bug labels Aug 19, 2022
@AnnaSasDev
Copy link

experienced the same issue

@hoffstadt hoffstadt added priority: high high priority state: ready Fixed/Added and will be present in an upcoming release and removed state: pending not addressed yet labels Oct 22, 2022
@hoffstadt
Copy link
Owner

Fixed in next release.

@qizheng-1998
Copy link

Seems like the program still crashing when clear the plot with custom_series

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
priority: high high priority state: ready Fixed/Added and will be present in an upcoming release type: bug bug
Projects
None yet
Development

No branches or pull requests

4 participants