mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +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
|
/// reset associated Buffer to null value
|
||||||
virtual void resetBuffer();
|
virtual void resetBuffer();
|
||||||
/// retrieve associated Buffer
|
/// retrieve associated Buffer
|
||||||
virtual Buffer & buffer();
|
Buffer & buffer();
|
||||||
virtual Buffer const & buffer() const;
|
Buffer const & buffer() const;
|
||||||
/// Returns true if buffer_ actually points to a Buffer that has
|
/// Returns true if buffer_ actually points to a Buffer that has
|
||||||
/// been loaded into LyX and is still open. Note that this will
|
/// been loaded into LyX and is still open. Note that this will
|
||||||
/// always return false for cloned Buffers. If you want to allow
|
/// always return false for cloned Buffers. If you want to allow
|
||||||
|
@ -68,6 +68,9 @@ InsetBibitem::InsetBibitem(Buffer * buf, InsetCommandParams const & p)
|
|||||||
InsetBibitem::~InsetBibitem()
|
InsetBibitem::~InsetBibitem()
|
||||||
{
|
{
|
||||||
if (isBufferLoaded())
|
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();
|
buffer().invalidateBibinfoCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,7 +68,11 @@ InsetBibtex::InsetBibtex(Buffer * buf, InsetCommandParams const & p)
|
|||||||
InsetBibtex::~InsetBibtex()
|
InsetBibtex::~InsetBibtex()
|
||||||
{
|
{
|
||||||
if (isBufferLoaded()) {
|
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();
|
buffer().invalidateBibfileCache();
|
||||||
|
// coverity[exn_spec_violation]
|
||||||
buffer().removeBiblioTempFiles();
|
buffer().removeBiblioTempFiles();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -198,6 +198,9 @@ InsetInclude::InsetInclude(InsetInclude const & other)
|
|||||||
InsetInclude::~InsetInclude()
|
InsetInclude::~InsetInclude()
|
||||||
{
|
{
|
||||||
if (isBufferLoaded())
|
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();
|
buffer().invalidateBibfileCache();
|
||||||
delete label_;
|
delete label_;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user