Exemple #1
0
void Z_Shutdown(void)
{
    int             numVolumes = 0;
    size_t          totalMemory = 0;

    // Get rid of possible zone-allocated memory in the garbage.
    Garbage_RecycleAllWithDestructor(Z_Free);

    // Destroy all the memory volumes.
    while (volumeRoot)
    {
        memvolume_t *vol = volumeRoot;
        volumeRoot = vol->next;

        // Calculate stats.
        numVolumes++;
        totalMemory += vol->size;

#ifdef LIBDENG_FAKE_MEMORY_ZONE
        Z_FreeTags(0, DDMAXINT);
#endif

        M_Free(vol->zone);
        M_Free(vol);
    }

    App_Log(DE2_LOG_NOTE,
            "Z_Shutdown: Used %i volumes, total %u bytes.", numVolumes, totalMemory);

    Sys_DestroyMutex(zoneMutex);
    zoneMutex = 0;
}
/**
 * Called after the busy mode worker thread and the event (sub-)loop has been stopped.
 */
static void endTask(BusyTask* task)
{
    DENG_ASSERT(task);
    DENG_ASSERT_IN_MAIN_THREAD();

    LOG_VERBOSE("Busy mode lasted %.2f seconds") << busyTime;

    if(busyTaskEndedWithError)
    {
        App_AbnormalShutdown(busyError);
    }

    if(busyWillAnimateTransition)
    {
        Con_TransitionBegin();
    }

    // Make sure that any remaining deferred content gets uploaded.
    if(!(task->mode & BUSYF_NO_UPLOADS))
    {
        GL_ProcessDeferredTasks(0);
    }

    Sys_DestroyMutex(busy_Mutex);
    busyInited = false;
}
Exemple #3
0
void Con_ShutdownProgress(void)
{
    if(progressMutex)
    {
        Sys_DestroyMutex(progressMutex);
    }
}
Exemple #4
0
Mutex::~Mutex()
{
  if (hObject_ != NULL)
  {
    Sys_DestroyMutex(hObject_);
    hObject_ = NULL;
  }
}
Exemple #5
0
/**
 * Shut down the low-level network interface. Called during engine
 * shutdown (not before).
 */
void N_Shutdown(void)
{
    // Any queued messages will be destroyed.
    N_ClearMessages();

    N_MasterShutdown();

    allowSending = false;

    // Close the handle of the message queue mutex.
    Sys_DestroyMutex(msgMutex);
    msgMutex = 0;
}
Exemple #6
0
void CBuffer_Delete(CBuffer* cb)
{
    assert(cb);

    lock(cb, true);

    clearText(cb, false);
    clearWriteBuffer(cb);
    clearIndex(cb);
    clearUsedNodes(cb);

    lock(cb, false);
    Sys_DestroyMutex(cb->mutex);
    cb->mutex = 0;
    free(cb);
}
void FileHandleBuilder::shutdown(void)
{
#if 0
    if(inited)
    {
        Sys_Lock(mutex);
        BlockSet_Delete(handleBlockSet); handleBlockSet = 0;
        usedHandles = 0;
        Sys_Unlock(mutex);
        Sys_DestroyMutex(mutex); mutex = 0;
        inited = false;
        return;
    }
#if _DEBUG
    Con_Error("FileHandleBuilder::shutdown: Not presently initialized.");
#endif
#endif
}
Exemple #8
0
 ~RingBuffer()
 {
     delete [] _buf;
     Sys_DestroyMutex(_mutex);
 }