Menu

#1210 Scope~ can trigger a Tcl error

v0.46
open
cyclone (5)
5
2017-02-14
2015-06-28
No

The cyclone/Scope~ object can trigger a Tcl error with the following situation:

  • the patch is in edit mode,
  • the object is selected and
  • the patch window is minimized and then restored.

Pd has to be restarted to be usable again.

Issue detected with Xubuntu 14.04 64-bit. Pd version is 0.46.6.

(Tcl) UNHANDLED ERROR: window name "h20c4180" already exists in parent
while executing
"canvas .x20ac410.h20c4180 -width 10 -height 10 -bg #fedc00 -bd 0"
("uplevel" body line 145)
invoked from within
"uplevel #0 $docmds"

Discussion

  • electrickery

    electrickery - 2015-06-28

    Discussion:
    The c code does not properly track the selected state of the object in Tcl/Tk, and tries to create the 'selected'-objects again on the window restore (by calling scope_select).

    The fix includes a sh->h_selectedmode variable in the scopehandle object tracking the selected state in Tcl/Tk. To keep the code change simple, the object is deselected when it is found selected so it is save to select it again.

    There is a 'state' argument which is the 'should be'-state, sh->h_selectedmode is the 'is'-state, or current state.

    The fix will be commited after more testing.

     
  • Alexandre Porres

    has this been fixed?

     
  • electrickery

    electrickery - 2017-02-14

    As of https://github.com/electrickery/pd-miXedSon/commit/38c48e802e102eb8fe98a4af499682a9a0bb0114.
    There is stil a residual issue; a newly created Scope~ is not selected by default. But this was already the case, so a separate issue.

     

Anonymous
Anonymous

Add attachments
Cancel