]> git.lyx.org Git - lyx.git/blobdiff - src/Buffer.cpp
This comment is wrong and causes bug in revision control.
[lyx.git] / src / Buffer.cpp
index 9b39c2979e8aafdcbe1d9ecc5022fcd6bb7d4841..b38a394b48d164d40455db83d492d09a4acc5494 100644 (file)
@@ -275,6 +275,13 @@ Buffer::~Buffer()
        // GuiView already destroyed
        gui_ = 0;
 
+
+       // loop over children
+       Impl::BufferPositionMap::iterator it = d->children_positions.begin();
+       Impl::BufferPositionMap::iterator end = d->children_positions.end();
+       for (; it != end; ++it)
+               theBufferList().releaseChild(this, const_cast<Buffer *>(it->first));
+
        // clear references to children in macro tables
        d->children_positions.clear();
        d->position_to_children.clear();
@@ -1394,7 +1401,6 @@ BiblioInfo const & Buffer::localBibInfo() const
                support::FileNameList::const_iterator en = bibfilesCache.end();
                for (; ei != en; ++ ei) {
                        time_t lastw = ei->lastModified();
-                       LYXERR0(*ei << ", " << lastw << ", " << d->bibfileStatus_[*ei]); 
                        if (lastw != d->bibfileStatus_[*ei]) {
                                d->bibinfoCacheValid_ = false;
                                d->bibfileStatus_[*ei] = lastw;
@@ -1675,6 +1681,12 @@ Buffer const * Buffer::masterBuffer() const
 }
 
 
+bool Buffer::isChild(Buffer * child) const
+{
+       return d->children_positions.find(child) != d->children_positions.end();
+}
+
+
 template<typename M>
 typename M::iterator greatest_below(M & m, typename M::key_type const & x)
 {