ext/Yk/stl_tree_tz.h in YkESet-0.99.1 vs ext/Yk/stl_tree_tz.h in YkESet-0.99.2
- old
+ new
@@ -211,12 +211,16 @@
}
}
_Rb_tree_iterator<_Tp>& operator=(const _Rb_tree_iterator<_Tp>& arg){
if(_M_node != arg._M_node){
- if(_M_node)
+ if(_M_node){
_M_node->_TZ_refCount -= 1;
+ if(_M_node->_TZ_refCount == 0 && _M_node->_TZ_destroyer){
+ _M_node->_TZ_destroyer((_Rb_tree_node_base*)_M_node);
+ }
+ }
_M_node = arg._M_node;
if(_M_node)
_M_node->_TZ_refCount += 1;
}
return *this;
@@ -322,11 +326,15 @@
}
}
_Rb_tree_const_iterator<_Tp>& operator=(const _Rb_tree_const_iterator<_Tp>& arg){
if(_M_node != arg._M_node){
- if(_M_node)
+ if(_M_node){
((_Rb_tree_node_base*)_M_node)->_TZ_refCount -= 1;
+ if(_M_node->_TZ_refCount == 0 && _M_node->_TZ_destroyer){
+ _M_node->_TZ_destroyer((_Rb_tree_node_base*)_M_node);
+ }
+ }
_M_node = arg._M_node;
if(_M_node)
((_Rb_tree_node_base*)_M_node)->_TZ_refCount += 1;
}
return *this;