bugGNU Octave - Bugs: bug #45261, cannot close figure after multiple...

 
 

bug #45261: cannot close figure after multiple calls to ginput()

Submitter:  Philip Nienhuis <philipnienhuis>
Submitted:  Fri 05 Jun 2015 07:25:02 PM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  Philip Nienhuis Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 06 Jun 2015 03:40:40 PM UTC, comment #5: 

Thanks for the quick fix!

Philip Nienhuis <philipnienhuis>
Group Member
Sat 06 Jun 2015 03:28:02 PM UTC, comment #4: 

Sorry, I forgot to restore the original closereq function at the end of a normal termination of ginput.  I fixed that here (http://hg.savannah.gnu.org/hgweb/octave/rev/b93a155dc200) and I can now run ginput more than once.

Rik <rik5>
Group administrator
Sat 06 Jun 2015 02:27:47 PM UTC, comment #3: 

Ok, confirmed here. Also affects FLTK toolkit. The error is due to this change:

http://hg.savannah.gnu.org/hgweb/octave/rev/2283dd03bf50

but I haven't even glanced at the diff to see what might be the cause.

Mike Miller <mtmiller>
Group Member
Sat 06 Jun 2015 12:43:03 PM UTC, comment #2: 

You're right, works in 4.0.0 but not in dev (4.1.0+)

BTW plot ... isn't even required, just ginput(1) twice will do the trick.

Adapting "release"

Philip Nienhuis <philipnienhuis>
Group Member
Sat 06 Jun 2015 02:05:21 AM UTC, comment #1: 

I don't get the error you're seeing with 4.0.0. Qt toolkit, with or without GUI running? I ran the commands in your example and the figure closed without any error.

Mike Miller <mtmiller>
Group Member
Fri 05 Jun 2015 07:25:02 PM UTC, original submission:  

Steps to reproduce:

>> plot ([0 10]);   ## Just some plot
>> [x, y, b] = ginput ();
>> [x, y, b] = ginput ();
>> [x, y, b] = ginput ();  # repeated several times
:
:
>> close
error: feval: first argument must be a string, inline function or a function handle
error: called from
    ginput>ginput_closerequestfcn at line 152 column 3
    close at line 96 column 5


Looking in ginput.m in debug mode, I see that variable orig_closerequestfcn, that is a string "close_req" after the first call, is turned into a cell array that upon each following call to ginput gets nested deeper in the following fashion:

debug> orig_closerequestfcn
orig_closerequestfcn =
{
  [1,1] = @ginput_closerequestfcn
  [2,1] =
  {
    [1,1] = @ginput_closerequestfcn
    [2,1] =
    {
      [1,1] = @ginput_closerequestfcn
      [2,1] = closereq
    }
  }
}


While I'm overall almost clueless about Octave's graphics innards, I think the error message clearly indicates that feval doesn't expect a cell array. The call in L.73:

:
orig_closerequestfcn = get (fig, "closerequestfcn");
:


seems to be the culprit as it is there where the cell array is produced.

Closing a figure after multiple calls to ginput() used to work, hence "regression"

Philip Nienhuis <philipnienhuis>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by philipnienhuis (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-06-06 rik5 StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2015-06-06 mtmiller StatusWorks For Me Confirmed
        SummaryQt: cannot close figure after multiple calls to ginput() cannot close figure after multiple calls to ginput()
    2015-06-06 philipnienhuis Release4.0.0 dev
    2015-06-06 mtmiller StatusNone Works For Me

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code