[Matlab] Add missing 'clear' functions
Without these functions, it was impossible to use these classes without leaking memory. Even with these functions, the memory is released only when these functions are explicitly called, as old-style Matlab classes have no notion of a destructor. Fixes #252.
This commit is contained in:
parent
2161060743
commit
258fb8ed57
7 changed files with 57 additions and 0 deletions
9
interfaces/matlab/toolbox/1D/@Domain1D/clear.m
Normal file
9
interfaces/matlab/toolbox/1D/@Domain1D/clear.m
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
function clear(d)
|
||||
% CLEAR Delete the C++ Domain1D object.
|
||||
% clear(d)
|
||||
% :param d:
|
||||
% Instance of class :mat:func:`Domain1D` (or another
|
||||
% object that derives from Domain1D)
|
||||
%
|
||||
|
||||
domain_methods(d.dom_id, 10);
|
||||
8
interfaces/matlab/toolbox/1D/@Stack/clear.m
Normal file
8
interfaces/matlab/toolbox/1D/@Stack/clear.m
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
function clear(s)
|
||||
% CLEAR Delete the C++ Sim1D object.
|
||||
% clear(s)
|
||||
% :param s:
|
||||
% Instance of class :mat:func:`Stack`
|
||||
%
|
||||
|
||||
stack_methods(s.stack_id, 110);
|
||||
8
interfaces/matlab/toolbox/@Func/clear.m
Normal file
8
interfaces/matlab/toolbox/@Func/clear.m
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
function clear(f)
|
||||
% CLEAR Delete the C++ Func1 object.
|
||||
% clear(f)
|
||||
% :param f:
|
||||
% Instance of class :mat:func:`Func`
|
||||
%
|
||||
|
||||
funcmethods(f.index, 1);
|
||||
8
interfaces/matlab/toolbox/@Mixture/clear.m
Normal file
8
interfaces/matlab/toolbox/@Mixture/clear.m
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
function clear(m)
|
||||
% CLEAR Delete the C++ MultiPhase object.
|
||||
% clear(m)
|
||||
% :param m:
|
||||
% Instance of class :mat:func:`Mixture`
|
||||
%
|
||||
|
||||
mixturemethods(1, m.mixindex);
|
||||
8
interfaces/matlab/toolbox/@ReactorNet/clear.m
Normal file
8
interfaces/matlab/toolbox/@ReactorNet/clear.m
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
function clear(n)
|
||||
% CLEAR Delete the C++ ReactorNet object.
|
||||
% clear(n)
|
||||
% :param n:
|
||||
% Instance of class :mat:func:`ReactorNet`
|
||||
%
|
||||
|
||||
reactornetmethods(1, n.index);
|
||||
8
interfaces/matlab/toolbox/@Wall/clear.m
Normal file
8
interfaces/matlab/toolbox/@Wall/clear.m
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
function clear(w)
|
||||
% CLEAR Delete the C++ Wall object.
|
||||
% clear(w)
|
||||
% :param w:
|
||||
% Instance of class :mat:func:`Wall`
|
||||
%
|
||||
|
||||
wallmethods(1, w.index);
|
||||
8
interfaces/matlab/toolbox/@XML_Node/clear.m
Normal file
8
interfaces/matlab/toolbox/@XML_Node/clear.m
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
function clear(x)
|
||||
% CLEAR Delete the C++ XML_Node object.
|
||||
% clear(x)
|
||||
% :param x:
|
||||
% Instance of class :mat:func:`XML_Node`
|
||||
%
|
||||
|
||||
ctmethods(10, 1, x.id);
|
||||
Loading…
Add table
Reference in a new issue