コード例 #1
0
ファイル: embedded-vfs.cpp プロジェクト: Orvid/hhvm
int sqlite3_embedded_shutdown() {
  if ( gEmbedded.isInitialized==0 ) return SQLITE_MISUSE;
  gEmbedded.isInitialized = 0;
  sqlite3_mutex_free(gEmbedded.pMutex);
  sqlite3_vfs_unregister(&gEmbedded.sThisVfs);
  memset(&gEmbedded, 0, sizeof(gEmbedded));
  return SQLITE_OK;
}
コード例 #2
0
ファイル: PackageService.cpp プロジェクト: noriter/nit
static void FinishSqliteVFS()
{
	assert(g_NitSqliteVFS);

	sqlite3_vfs_unregister(g_NitSqliteVFS);

	safeDelete(g_NitSqliteVFS);
}
コード例 #3
0
/*
** CAPI: Shutdown the multiplex system - sqlite3_multiplex_shutdown()
**
** All SQLite database connections must be closed before calling this
** routine.
**
** THIS ROUTINE IS NOT THREADSAFE.  Call this routine exactly once while
** shutting down in order to free all remaining multiplex groups.
*/
int sqlite3_multiplex_shutdown(void){
  if( gMultiplex.isInitialized==0 ) return SQLITE_MISUSE;
  if( gMultiplex.pGroups ) return SQLITE_MISUSE;
  gMultiplex.isInitialized = 0;
  sqlite3_mutex_free(gMultiplex.pMutex);
  sqlite3_vfs_unregister(&gMultiplex.sThisVfs);
  memset(&gMultiplex, 0, sizeof(gMultiplex));
  return SQLITE_OK;
}
コード例 #4
0
Service::~Service()
{
  mozilla::UnregisterWeakMemoryReporter(this);
  mozilla::UnregisterStorageSQLiteDistinguishedAmount();

  int rc = sqlite3_vfs_unregister(mSqliteVFS);
  if (rc != SQLITE_OK)
    NS_WARNING("Failed to unregister sqlite vfs wrapper.");

  gService = nullptr;
  delete mSqliteVFS;
  mSqliteVFS = nullptr;
}
コード例 #5
0
/*
** CAPI: Shutdown the multiplex system - sqlite3_multiplex_shutdown()
**
** All SQLite database connections must be closed before calling this
** routine.
**
** THIS ROUTINE IS NOT THREADSAFE.  Call this routine exactly once while
** shutting down in order to free all remaining multiplex groups.
*/
int sqlite3_multiplex_shutdown(int eForce){
  int rc = SQLITE_OK;
  if( gMultiplex.isInitialized==0 ) return SQLITE_MISUSE;
  if( gMultiplex.pGroups ){
    sqlite3_log(SQLITE_MISUSE, "sqlite3_multiplex_shutdown() called "
                "while database connections are still open");
    if( !eForce ) return SQLITE_MISUSE;
    rc = SQLITE_MISUSE;
  }
  gMultiplex.isInitialized = 0;
  sqlite3_mutex_free(gMultiplex.pMutex);
  sqlite3_vfs_unregister(&gMultiplex.sThisVfs);
  memset(&gMultiplex, 0, sizeof(gMultiplex));
  return rc;
}
コード例 #6
0
ファイル: test_quota.c プロジェクト: ehsan/mozilla-history
/*
** Shutdown the quota system.
**
** All SQLite database connections must be closed before calling this
** routine.
**
** THIS ROUTINE IS NOT THREADSAFE.  Call this routine exactly once while
** shutting down in order to free all remaining quota groups.
*/
int sqlite3_quota_shutdown(void){
  quotaGroup *pGroup;
  if( gQuota.isInitialized==0 ) return SQLITE_MISUSE;
  for(pGroup=gQuota.pGroup; pGroup; pGroup=pGroup->pNext){
    if( quotaGroupOpenFileCount(pGroup)>0 ) return SQLITE_MISUSE;
  }
  while( gQuota.pGroup ){
    pGroup = gQuota.pGroup;
    gQuota.pGroup = pGroup->pNext;
    pGroup->iLimit = 0;
    assert( quotaGroupOpenFileCount(pGroup)==0 );
    quotaGroupDeref(pGroup);
  }
  gQuota.isInitialized = 0;
  sqlite3_mutex_free(gQuota.pMutex);
  sqlite3_vfs_unregister(&gQuota.sThisVfs);
  memset(&gQuota, 0, sizeof(gQuota));
  return SQLITE_OK;
}
コード例 #7
0
Service::~Service()
{
  mozilla::UnregisterWeakMemoryReporter(this);
  mozilla::UnregisterStorageSQLiteDistinguishedAmount();

  int rc = sqlite3_vfs_unregister(mSqliteVFS);
  if (rc != SQLITE_OK)
    NS_WARNING("Failed to unregister sqlite vfs wrapper.");

  // Shutdown the sqlite3 API.  Warn if shutdown did not turn out okay, but
  // there is nothing actionable we can do in that case.
  rc = ::sqlite3_shutdown();
  if (rc != SQLITE_OK)
    NS_WARNING("sqlite3 did not shutdown cleanly.");

  DebugOnly<bool> shutdownObserved = !sXPConnect;
  NS_ASSERTION(shutdownObserved, "Shutdown was not observed!");

  gService = nullptr;
  delete mSqliteVFS;
  mSqliteVFS = nullptr;
}
コード例 #8
0
ファイル: spmemvfs.c プロジェクト: shujaatak/luckygps2
void spmemvfs_env_fini()
{
	if( NULL != g_spmemvfs_env ) {
		spmembuffer_link_t * iter = NULL;

		sqlite3_vfs_unregister( (sqlite3_vfs*)&g_spmemvfs );

		sqlite3_mutex_free( g_spmemvfs_env->mutex );

		iter = g_spmemvfs_env->head;
		for( ; NULL != iter; ) {
			spmembuffer_link_t * next = iter->next;

			spmembuffer_link_free( iter );

			iter = next;
		}

		free( g_spmemvfs_env );
		g_spmemvfs_env = NULL;
	}
}
コード例 #9
0
/*
** Uninstall the jt VFS, if it is installed.
*/
void jt_unregister(void){
  sqlite3_vfs_unregister(&jt_vfs);
}
コード例 #10
0
ファイル: Vfs.cpp プロジェクト: yasuikentarow/xorsql
/***********************************************************************//**
	@brief デストラクタ
***************************************************************************/
Vfs::~Vfs() {
  sqlite3_vfs_unregister(static_cast<sqlite3_vfs*>(this));
}
コード例 #11
0
void sqlite3_bctbx_vfs_unregister(void)
{
	sqlite3_vfs* pVfs = sqlite3_vfs_find(LINPHONE_SQLITE3_VFS);
	sqlite3_vfs_unregister(pVfs);
}