/ Check-in [240f7252]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:For the vtshim module, always zero out the xChildDestroy function pointer after calling it.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 240f7252c66ad3ff5ae0ef06455c1ff9bd78bbb4
User & Date: mistachkin 2013-08-05 21:54:17
Context
2013-08-05
22:05
Performance optimization: Avoid calling convertCompoundSelecctToSubquery() on queries that do not use the UNION, EXCEPT, or INTERSECT operators. check-in: c589b2fe user: drh tags: trunk
21:54
For the vtshim module, always zero out the xChildDestroy function pointer after calling it. check-in: 240f7252 user: mistachkin tags: trunk
19:11
Factor all KeyInfo object allocations into a single function: sqlite3KeyInfoAlloc(). Always allocate enough space so that sqlite3VdbeRecordCompare() can avoid checking boundaries and hence run faster. check-in: 7301bedd user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ext/misc/vtshim.c.

425
426
427
428
429
430
431

432
433
434
435
436
437
438
...
523
524
525
526
527
528
529

530


531
532
533
534
535
536
537

/* The destructor function for a disposible module */
static void vtshimAuxDestructor(void *pXAux){
  vtshim_aux *pAux = (vtshim_aux*)pXAux;
  assert( pAux->pAllVtab==0 );
  if( !pAux->bDisposed && pAux->xChildDestroy ){
    pAux->xChildDestroy(pAux->pChildAux);

  }
  sqlite3_free(pAux->zName);
  sqlite3_free(pAux->pMod);
  sqlite3_free(pAux);
}

static int vtshimCopyModule(
................................................................................
    for(pVtab=pAux->pAllVtab; pVtab; pVtab=pVtab->pNext){
      for(pCur=pVtab->pAllCur; pCur; pCur=pCur->pNext){
        pAux->pMod->xClose(pCur->pChild);
      }
      pAux->pMod->xDisconnect(pVtab->pChild);
    }
    pAux->bDisposed = 1;

    if( pAux->xChildDestroy ) pAux->xChildDestroy(pAux->pChildAux);


  }
}


#endif /* SQLITE_OMIT_VIRTUALTABLE */

#ifdef _WIN32







>







 







>
|
>
>







425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
...
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541

/* The destructor function for a disposible module */
static void vtshimAuxDestructor(void *pXAux){
  vtshim_aux *pAux = (vtshim_aux*)pXAux;
  assert( pAux->pAllVtab==0 );
  if( !pAux->bDisposed && pAux->xChildDestroy ){
    pAux->xChildDestroy(pAux->pChildAux);
    pAux->xChildDestroy = 0;
  }
  sqlite3_free(pAux->zName);
  sqlite3_free(pAux->pMod);
  sqlite3_free(pAux);
}

static int vtshimCopyModule(
................................................................................
    for(pVtab=pAux->pAllVtab; pVtab; pVtab=pVtab->pNext){
      for(pCur=pVtab->pAllCur; pCur; pCur=pCur->pNext){
        pAux->pMod->xClose(pCur->pChild);
      }
      pAux->pMod->xDisconnect(pVtab->pChild);
    }
    pAux->bDisposed = 1;
    if( pAux->xChildDestroy ){
      pAux->xChildDestroy(pAux->pChildAux);
      pAux->xChildDestroy = 0;
    }
  }
}


#endif /* SQLITE_OMIT_VIRTUALTABLE */

#ifdef _WIN32