DearPyGui icon indicating copy to clipboard operation
DearPyGui copied to clipboard

Deleting a texture causes a seg fault

Open jamesnunn opened this issue 2 years ago • 1 comments

Version of Dear PyGui

Version: 1.10.1 Operating System: PopOS 22.04 using dedicated Nvidia graphics card. Can't reproduce with integrated graphics

My Issue/Question

A clear and concise description of what the issue/question is. Please provide as much context as possible.

To Reproduce

Run the code, click the delete button, crash ensues on my system. Others on Discord unable to reproduce

Expected behavior

No crash, and the texture to be deleted

Standalone, minimal, complete and verifiable example

import dearpygui.dearpygui as dpg

dpg.create_context()


def remove_stuff():
    dpg.delete_item("texture_tag")


texture_data = []
for i in range(0, 100 * 100):
    texture_data.append(255 / 255)
    texture_data.append(0)
    texture_data.append(255 / 255)
    texture_data.append(255 / 255)

with dpg.texture_registry(tag="asset_registry", show=True):
    dpg.add_static_texture(width=100, height=100, default_value=texture_data, tag="texture_tag")
with dpg.window():
    dpg.add_button(label="Del", callback=remove_stuff)

dpg.create_viewport(title="Custom Title", width=300, height=300)
dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()

jamesnunn avatar Nov 09 '23 16:11 jamesnunn

Anyone searching for possible workaround, take a look at: #554

Shoun2137 avatar Dec 13 '23 15:12 Shoun2137