mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 985017 - [1/2] Support null VolatileBufferPtrs, r=glandium
This commit is contained in:
parent
041fce1065
commit
2604c0561e
@ -8,6 +8,7 @@
|
||||
#include "mozilla/mozalloc.h"
|
||||
#include "mozilla/RefPtr.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/NullPtr.h"
|
||||
|
||||
/* VolatileBuffer
|
||||
*
|
||||
@ -78,11 +79,18 @@ private:
|
||||
class VolatileBufferPtr_base {
|
||||
public:
|
||||
VolatileBufferPtr_base(VolatileBuffer* vbuf) : mVBuf(vbuf) {
|
||||
mPurged = !vbuf->Lock(&mMapping);
|
||||
if (vbuf) {
|
||||
mPurged = !vbuf->Lock(&mMapping);
|
||||
} else {
|
||||
mMapping = nullptr;
|
||||
mPurged = false;
|
||||
}
|
||||
}
|
||||
|
||||
~VolatileBufferPtr_base() {
|
||||
mVBuf->Unlock();
|
||||
if (mVBuf) {
|
||||
mVBuf->Unlock();
|
||||
}
|
||||
}
|
||||
|
||||
bool WasBufferPurged() const {
|
||||
|
Loading…
Reference in New Issue
Block a user