Index: src/main.c ================================================================== --- src/main.c +++ src/main.c @@ -175,10 +175,16 @@ ** malloc subsystem - this implies that the allocation of a static ** mutex must not require support from the malloc subsystem. */ MUTEX_LOGIC( pMaster = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); ) sqlite3_mutex_enter(pMaster); + if( sqlite3GlobalConfig.isInit ){ + assert( sqlite3GlobalConfig.isMutexInit ); + assert( sqlite3GlobalConfig.isMallocInit ); + sqlite3_mutex_leave(pMaster); + return SQLITE_OK; + } sqlite3GlobalConfig.isMutexInit = 1; if( !sqlite3GlobalConfig.isMallocInit ){ rc = sqlite3MallocInit(); } if( rc==SQLITE_OK ){