mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 05:16:21 +00:00
Annotate destructors to please coverity
Coverity flags this code as not handling exception that may happen in buffer(). My own analysis is that this can never happen because isBufferValid() does check whether buffer_ is null. Any insght appreciated. The commit should be expeanded to more cases, actually.
This commit is contained in:
parent
0d6c64a4eb
commit
e10db6c7dd
@ -112,8 +112,8 @@ public:
|
||||
/// reset associated Buffer to null value
|
||||
virtual void resetBuffer();
|
||||
/// retrieve associated Buffer
|
||||
virtual Buffer & buffer();
|
||||
virtual Buffer const & buffer() const;
|
||||
Buffer & buffer();
|
||||
Buffer const & buffer() const;
|
||||
/// Returns true if buffer_ actually points to a Buffer that has
|
||||
/// been loaded into LyX and is still open. Note that this will
|
||||
/// always return false for cloned Buffers. If you want to allow
|
||||
|
@ -68,6 +68,9 @@ InsetBibitem::InsetBibitem(Buffer * buf, InsetCommandParams const & p)
|
||||
InsetBibitem::~InsetBibitem()
|
||||
{
|
||||
if (isBufferLoaded())
|
||||
/* Coverity believs that this may throw an exception, but
|
||||
* actually this code path is not taken when buffer_ == 0 */
|
||||
// coverity[exn_spec_violation]
|
||||
buffer().invalidateBibinfoCache();
|
||||
}
|
||||
|
||||
|
@ -68,7 +68,11 @@ InsetBibtex::InsetBibtex(Buffer * buf, InsetCommandParams const & p)
|
||||
InsetBibtex::~InsetBibtex()
|
||||
{
|
||||
if (isBufferLoaded()) {
|
||||
/* Coverity believs that this may throw an exception, but
|
||||
* actually this code path is not taken when buffer_ == 0 */
|
||||
// coverity[exn_spec_violation]
|
||||
buffer().invalidateBibfileCache();
|
||||
// coverity[exn_spec_violation]
|
||||
buffer().removeBiblioTempFiles();
|
||||
}
|
||||
}
|
||||
|
@ -198,6 +198,9 @@ InsetInclude::InsetInclude(InsetInclude const & other)
|
||||
InsetInclude::~InsetInclude()
|
||||
{
|
||||
if (isBufferLoaded())
|
||||
/* Coverity believs that this may throw an exception, but
|
||||
* actually this code path is not taken when buffer_ == 0 */
|
||||
// coverity[exn_spec_violation]
|
||||
buffer().invalidateBibfileCache();
|
||||
delete label_;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user