changeset 28900:f8efd03a553e

maint: merge stable to default.
author Markus Mützel <markus.muetzel@gmx.de>
date Tue, 13 Oct 2020 20:08:05 +0200
parents caf577e7ef43 (current diff) 02f0649f43d7 (diff)
children 3c37ae43996a
files libinterp/octave-value/ov.h liboctave/array/idx-vector.h
diffstat 3 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/octave-value/ov.h	Mon Oct 12 17:14:08 2020 +0200
+++ b/libinterp/octave-value/ov.h	Tue Oct 13 20:08:05 2020 +0200
@@ -333,7 +333,7 @@
     // operator, rep may be a nullptr here.  We should only need to
     // protect the move assignment operator in a similar way.
 
-    if (rep && --rep->count == 0)
+    if (rep && --rep->count == 0 && rep != nil_rep ())
       delete rep;
   }
 
@@ -343,7 +343,7 @@
       {
         octave_base_value *r = rep->unique_clone ();
 
-        if (--rep->count == 0)
+        if (--rep->count == 0 && rep != nil_rep ())
           delete rep;
 
         rep = r;
@@ -359,7 +359,7 @@
       {
         octave_base_value *r = rep->unique_clone ();
 
-        if (--rep->count == 0)
+        if (--rep->count == 0 && rep != nil_rep ())
           delete rep;
 
         rep = r;
@@ -372,7 +372,7 @@
   {
     if (rep != a.rep)
       {
-        if (--rep->count == 0)
+        if (--rep->count == 0 && rep != nil_rep ())
           delete rep;
 
         rep = a.rep;
@@ -390,7 +390,7 @@
 
     if (this != &a)
       {
-        if (rep && --rep->count == 0)
+        if (rep && --rep->count == 0 && rep != nil_rep ())
           delete rep;
 
         rep = a.rep;
--- a/liboctave/array/idx-vector.h	Mon Oct 12 17:14:08 2020 +0200
+++ b/liboctave/array/idx-vector.h	Tue Oct 13 20:08:05 2020 +0200
@@ -543,7 +543,7 @@
 
   ~idx_vector (void)
   {
-    if (--rep->count == 0)
+    if (--rep->count == 0 && rep != nil_rep ())
       delete rep;
   }
 
@@ -551,7 +551,7 @@
   {
     if (this != &a)
       {
-        if (--rep->count == 0)
+        if (--rep->count == 0 && rep != nil_rep ())
           delete rep;
 
         rep = a.rep;
--- a/liboctave/util/oct-shlib.h	Mon Oct 12 17:14:08 2020 +0200
+++ b/liboctave/util/oct-shlib.h	Tue Oct 13 20:08:05 2020 +0200
@@ -129,7 +129,7 @@
 
     ~dynamic_library (void)
     {
-      if (--m_rep->m_count == 0)
+      if (--m_rep->m_count == 0 && m_rep != &s_nil_rep)
         delete m_rep;
     }
 
@@ -143,7 +143,7 @@
     {
       if (m_rep != sl.m_rep)
         {
-          if (--m_rep->m_count == 0)
+          if (--m_rep->m_count == 0 && m_rep != &s_nil_rep)
             delete m_rep;
 
           m_rep = sl.m_rep;