Changeset: 13ca3ebad332 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/13ca3ebad332
Modified Files:
        monetdb5/modules/mal/manifold.c
Branch: Jul2021
Log Message:

Don't keep the reference on error


diffs (31 lines):

diff --git a/monetdb5/modules/mal/manifold.c b/monetdb5/modules/mal/manifold.c
--- a/monetdb5/modules/mal/manifold.c
+++ b/monetdb5/modules/mal/manifold.c
@@ -344,11 +344,6 @@ MANIFOLDevaluate(Client cntxt, MalBlkPtr
        msg = MANIFOLDjob(&mut);
        freeInstruction(mut.pci);
 
-       // consolidate the properties
-       if (ATOMstorage(mat[0].b->ttype) < TYPE_str)
-               BATsetcount(mat[0].b,cnt);
-       BATsettrivprop(mat[0].b);
-       BBPkeepref(*getArgReference_bat(stk,pci,0)=mat[0].b->batCacheid);
 wrapup:
        // restore the argument types
        for (i = pci->retc; i < pci->argc; i++){
@@ -357,6 +352,15 @@ wrapup:
                        BBPunfix(mat[i].b->batCacheid);
                }
        }
+       if (msg) {
+               BBPreclaim(mat[0].b);
+       } else if (!msg) {
+               // consolidate the properties
+               if (ATOMstorage(mat[0].b->ttype) < TYPE_str)
+                       BATsetcount(mat[0].b,cnt);
+               BATsettrivprop(mat[0].b);
+               
BBPkeepref(*getArgReference_bat(stk,pci,0)=mat[0].b->batCacheid);
+       }
        GDKfree(mat);
        return msg;
 }
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to