You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I create a node with a widget on it (for example a combobox), delete the node and close the application, the code breaks with and access violation return code.
Run the snippet below:
import sys
from PySide2.QtWidgets import QApplication
from NodeGraphQt import BaseNode, NodeGraph
class CustomNode(BaseNode):
__identifier__ = 'com.example'
NODE_NAME = 'Custom Node'
# region Constructor
def __init__(self):
super(CustomNode, self).__init__()
self.add_input('Input')
self.add_output('Output')
self.add_combo_menu(name='DROPDOWN_ID', items=[], tooltip='tooltip')
self._combobox = self.widgets()['DROPDOWN_ID'].get_custom_widget()
app = QApplication([])
# Create a graph
graph = NodeGraph()
# Add delete command to the context menu
context_menu = graph.get_context_menu('graph')
context_menu.add_command('&Delete', lambda: graph.delete_nodes(graph.selected_nodes()), 'QtGui.QKeySequence.Delete')
# Register the custom node
graph.register_node(CustomNode)
# Create an instance of the custom node and add it to the graph
graph.create_node('com.example.CustomNode', name=CustomNode.NODE_NAME)
# Create a window to display the graph
graph_widget = graph.widget
graph_widget.show()
# Start the application
sys.exit(app.exec_())
The error I get is:
Process finished with exit code -1073741819 (0xC0000005)
I use:
PySide2 5.15.2.1
NodeGraphQt 0.6.38
I tried debugging the dump file, but I could not find any trace of why it crashes (probably not deleting the Qt widgets properly?). I need help on this, I cannot use the application without being able to add any widget on the node and not crashing.
The text was updated successfully, but these errors were encountered:
While trying to debug this error I found out that if you force C++ to delete the item after being removed from the scene, it does not crash anymore (idea taken from https://stackoverflow.com/questions/63205311/how-to-delete-a-qgraphicsitem-in-pyqt5).
So I put:
shiboken2.delete(item_to_be_deleted) everywhere int the code where removeItem is called, and it doesn't break anymore.
(note aside, I use the pyside6 code from the open PR so I initially tested the fixing with shiboken6 and then retest it with shiboken2 to make sure it was working with the latest version).
Changes apply to these files:
Example from the node_abstract file:
It would be really nice if you can put that fixing in the next release, thanks!
If I create a node with a widget on it (for example a combobox), delete the node and close the application, the code breaks with and access violation return code.
Run the snippet below:
The error I get is:
Process finished with exit code -1073741819 (0xC0000005)
I use:
PySide2 5.15.2.1
NodeGraphQt 0.6.38
I tried debugging the dump file, but I could not find any trace of why it crashes (probably not deleting the Qt widgets properly?). I need help on this, I cannot use the application without being able to add any widget on the node and not crashing.
The text was updated successfully, but these errors were encountered: