From: Richard Heck Date: Tue, 10 Aug 2010 14:37:06 +0000 (+0000) Subject: Invalidate caches when the parent is reset. X-Git-Tag: 2.0.0~2819 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=89e50feaf2b46dd358823eb40e373cc001659326;p=lyx.git Invalidate caches when the parent is reset. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35115 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 5a228f4cc3..32e97b6840 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -279,12 +279,19 @@ public: parent_buffer = 0; return parent_buffer; } + /// void setParent(Buffer const * pb) { - if (!cloned_buffer_ - && parent_buffer && pb && parent_buffer != pb) + if (parent_buffer == pb) + // nothing to do + return; + if (!cloned_buffer_ && parent_buffer && pb) LYXERR0("Warning: a buffer should not have two parents!"); parent_buffer = pb; + if (!cloned_buffer_ && parent_buffer) { + parent_buffer->invalidateBibfileCache(); + parent_buffer->invalidateBibinfoCache(); + } } /// If non zero, this buffer is a clone of existing buffer \p cloned_buffer_