octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #60007] subsref indexing: No access to protect


From: Philipp Sibler
Subject: [Octave-bug-tracker] [bug #60007] subsref indexing: No access to protected items in handle class destructor
Date: Thu, 4 Feb 2021 16:41:19 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0

URL:
  <https://savannah.gnu.org/bugs/?60007>

                 Summary: subsref indexing: No access to protected items in
handle class destructor
                 Project: GNU Octave
            Submitted by: philsee
            Submitted on: Thu 04 Feb 2021 09:41:17 PM UTC
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Matlab Compatibility
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
                 Release: 6.1.0
         Discussion Lock: Any
        Operating System: Microsoft Windows

    _______________________________________________________

Details:

I generate several objects of a handle class. The destructor in this handle
class calls the protected method 'sendCommand' defined wihtin the same class.

Case 1: When clearing the objects individually ("clear myObj1, clear myObj2,
..."), the destructor each time is getting called properly, no problems.

Case 2: When I clear the entire environment with a "clear all" I get the
following warning for each destructed class object:

warning: error caught while executing handle class delete method:
subsref: method 'sendCommand' has protected access and cannot be run in this
context



Code example to force the issue
-------------------------------

classdef myClass < handle
  properties

  end
  methods
     function obj = myClass()

     end

     function delete(obj)
        obj.sendCommand(1);
     end
  end
  methods(Access=protected)
     function sendCommand(obj, cmd)
       fprintf('sendCommand called!\n');
     end
  end
end




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?60007>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]