Another place where refcnt in the COL_INFO object is unfortunately (#55)
authorAlexandr Kuznetsov <progmachine@xenlab.one>
Sat, 28 Sep 2024 20:29:00 +0000 (23:29 +0300)
committerGitHub <noreply@github.com>
Sat, 28 Sep 2024 20:29:00 +0000 (16:29 -0400)
erased.

Signed-off-by: Alexandr Kuznetsov <progmachine@xenlab.one>
descriptor.c

index 319c37b1193a3f3f4d651652000585b9b0c5249f..863cc76a52dbcd773db486fb33349c4b8ecc419b 100644 (file)
@@ -58,7 +58,11 @@ void    TI_ClearObject(TABLE_INFO *ti)
 MYLOG(0, "!!!refcnt %p:%d -> %d\n", coli, coli->refcnt, coli->refcnt - 1);
            coli->refcnt--;
            if (coli->refcnt <= 1 && 0 == coli->acc_time) /* acc_time == 0 means the table is dropped */
+           {
+               Int2 tmp_refcnt = coli->refcnt; /* If refcnt is still above 0, we must save it. */
                free_col_info_contents(coli); /* Now coli object is unused, and may be reused later. */
+               coli->refcnt = tmp_refcnt;
+           }
            if (coli->refcnt <= 0)
            {
                /* Last reference to coli object disappeared. Now destroying it. */