#include "buffer_funcs.h"
#include "Buffer.h"
+#include "BufferList.h"
#include "BufferParams.h"
#include "BufferView.h"
#include "CoordCache.h"
}
+bool Inset::isBufferValid() const
+{
+ return theBufferList().isLoaded(buffer_);
+}
+
+
docstring Inset::name() const
{
return from_ascii("unknown");
/// retrieve associated Buffer
virtual Buffer & buffer();
virtual Buffer const & buffer() const;
+ /// This checks whether the Buffer * actually points to an open
+ /// Buffer. It might not if that Buffer has been closed.
+ bool isBufferValid() const;
/// initialize view for this inset.
/**
InsetBibitem::~InsetBibitem()
{
- if (buffer_)
+ if (isBufferValid())
buffer_->invalidateBibinfoCache();
}
InsetBibtex::~InsetBibtex()
{
- if (buffer_)
+ if (isBufferValid())
buffer_->invalidateBibinfoCache();
}