Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 948 vs 949 for /trunk/Source Code/Platform/Video/CommandBufferPool.cpp

Diff revisions: vs.
  @@ -47,19 +47,21 @@
47 47 }
48 48
49 49 void CommandBufferPool::deallocateBuffer(CommandBuffer*& buffer) {
50 + if (buffer != nullptr) {
50 51 #if defined(USE_MEMORY_POOL)
51 - WriteLock lock(_mutex);
52 - _pool.deleteElement(buffer);
52 + WriteLock lock(_mutex);
53 + _pool.deleteElement(buffer);
53 54 #else
54 - size_t index = buffer->_index;
55 - buffer->clear();
55 + size_t index = buffer->_index;
56 + buffer->clear();
56 57
57 - WriteLock lock(s_mutex);
58 - s_freeList[index] = true;
58 + WriteLock lock(s_mutex);
59 + s_freeList[index] = true;
59 60 #endif
60 61
61 - buffer = nullptr;
62 - _bufferCount--;
62 + buffer = nullptr;
63 + _bufferCount--;
64 + }
63 65 }
64 66
65 67 ScopedCommandBuffer::ScopedCommandBuffer(bool useSecondaryBuffers)