[GRASS-git] [OSGeo/grass] 21623a: wxGUI/treemodel: Use weakref to fix deleting of no...

Anna Petrasova noreply at github.com
Sat Jul 11 20:09:18 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/OSGeo/grass
  Commit: 21623adb94b3a0cd71d0bab1be06c50e3822005f
      https://github.com/OSGeo/grass/commit/21623adb94b3a0cd71d0bab1be06c50e3822005f
  Author: Anna Petrasova <kratochanna at gmail.com>
  Date:   2020-07-11 (Sat, 11 Jul 2020)

  Changed paths:
    M gui/wxpython/core/treemodel.py

  Log Message:
  -----------
  wxGUI/treemodel: Use weakref to fix deleting of nodes (#778)

The proper common pattern for a tree in Python is nodes storing reference to parent as a weak reference.
This allows the nodes to be deleted after RemoveNode is called (and the caller's reference disappears).

Co-authored-by: Vaclav Petras <wenzeslaus at gmail.com>




More information about the grass-commit mailing list