DearPyGui icon indicating copy to clipboard operation
DearPyGui copied to clipboard

Empty array parameters (for example colormaps, series) cause DearPyGui to crash later on, making fault finding difficult.

Open markgloverswaybtinternetcom opened this issue 3 months ago • 3 comments

  1. PLEASE CAREFULLY READ: FAQ

  2. PLEASE CAREFULLY READ: Documentation

  3. FOR FIRST-TIME USERS ISSUES, please use the Discord server.

  4. REMOVE ALL 3RD PARTY LIBRARIES.

  5. PLEASE MAKE SURE that you have: read the FAQ; explored the examples; searched among Issues; and read the link provided in (1) (2).

  6. Be mindful that messages are being sent to the e-mail box of "Watching" users. Try to proof-read your messages before sending them. Edits are not seen by those users.

  7. Delete points 1-7 and PLEASE FILL THE TEMPLATE BELOW before submitting your issue or we will immediately close it.

Thank you!


Version of Dear PyGui

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

My Issue/Question

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

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots/Video

XXX (you can drag files here)

Standalone, minimal, complete and verifiable example

# Here's some code anyone can copy and paste to reproduce your issue
import dearpygui.dearpygui as dpg

dpg.create_context()
dpg.create_viewport()
dpg.setup_dearpygui()

with dpg.window(label="tutorial"):
    dpg.add_button(label="Press me")

more_code_to_explain_my_issue()

dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()

Please fill in the description as described in the template (see items 1-7 at the top).

v-ein avatar Sep 17 '25 17:09 v-ein

import dearpygui.dearpygui as dpg

class MainWindow():
def init(self):
self.colormapRegistry = dpg.add_colormap_registry(label="Colormap Registry") colours = [] # not intentional, can not reproduce failure self.colorMap = dpg.add_colormap(colours, qualitative=False, parent=self.colormapRegistry) with dpg.window(label="Death by empty array", width=-1, height=-1, pos=(0, 0), tag="Death by empty array"): with dpg.plot(label="Spectogram",height=600, no_menus=False, width=-1, crosshairs=True, no_mouse_pos=True): self.specPlot = dpg.last_item() dpg.bind_colormap(self.specPlot, self.colorMap) self.specXaxis = dpg.add_plot_axis(dpg.mvXAxis, no_gridlines=True, no_tick_marks=True, no_tick_labels=True, foreground_grid=True) self.specYaxis = dpg.add_plot_axis(dpg.mvYAxis, label="Frequency kHz", no_gridlines=False, no_tick_marks=False, no_tick_labels=False, foreground_grid=True) self.heatSeries = dpg.add_heat_series([], rows=1, cols=1, parent=self.specYaxis, format="", tag="spectrogram") # kills but may have been a different series if name == 'main': import dearpygui.dearpygui as dpg

dpg.create_context()
dpg.create_viewport(title='Death by empty array', width=400, height=400, x_pos=0, y_pos= 0)

main = MainWindow()
dpg.setup_dearpygui()
dpg.show_viewport()
dpg.set_primary_window("Death by empty array", True)
dpg.start_dearpygui() ################## dies here ###########
dpg.destroy_context()

Please use triple backquotes around your code snippets. Since Python relies on indentation, it's very difficult to understand the piece of code from your last comment. Alternatively, use the <> button on the formatting toolbar when you type the comment.

v-ein avatar Sep 20 '25 17:09 v-ein