Skip to content

Delete widget cause crash if widget is an image  #554

@GivralNguyen

Description

@GivralNguyen

Version of Dear PyGui

Version: 0.6.157
Operating System: Ubuntu 18.04 (Windows 10, macOs xx, Ubuntu 20.04, etc.)

My Issue/Question

Delete widget cause crash ( Segmentation fault (core dumped) ) if widget contains an image ( or image button). Otherwise it works fine.

To Reproduce

I follow the example in https://github.com/hoffstadt/DearPyGui/wiki/Runtime-Adding-and-Deleting-Widgets .

Example code

from dearpygui.core import *
from dearpygui.simple import *

def add_widgets(sender, data):

    with window("Secondary Window"): # simple
        #add_button("New Button")
        add_image_button("image","/home/quannm/DearPyGui/GUI/0183_c6s1_042351_01.jpg",show=True)
def delete_children(sender, data):
    delete_item("Secondary Window", children_only=True)

show_debug()

with window("Tutorial"):
    add_button("Add Window and Items", callback=add_widgets)
    add_button("Delete Window's Children", callback=delete_children)
start_dearpygui() 

Expected behavior

If you add button , the code works as intended. However, if you add an image ( or image button), the program crash when you try to delete widget.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions