Browse Source

Assert that the file is really closed after closing it in importer.

Should harden plugin implementations a bit more.
pull/23/head
Vladimír Vondruš 13 years ago
parent
commit
a7522e54ec
  1. 5
      src/Audio/AbstractImporter.cpp
  2. 5
      src/Text/AbstractFont.cpp
  3. 5
      src/Trade/AbstractImporter.cpp

5
src/Audio/AbstractImporter.cpp

@ -76,7 +76,10 @@ void AbstractImporter::doOpenFile(const std::string& filename) {
} }
void AbstractImporter::close() { void AbstractImporter::close() {
if(isOpened()) doClose(); if(isOpened()) {
doClose();
CORRADE_INTERNAL_ASSERT(!isOpened());
}
} }
Buffer::Format AbstractImporter::format() const { Buffer::Format AbstractImporter::format() const {

5
src/Text/AbstractFont.cpp

@ -100,7 +100,10 @@ void AbstractFont::doOpenFile(const std::string& filename, const Float size) {
} }
void AbstractFont::close() { void AbstractFont::close() {
if(isOpened()) doClose(); if(isOpened()) {
doClose();
CORRADE_INTERNAL_ASSERT(!isOpened());
}
} }
UnsignedInt AbstractFont::glyphId(const char32_t character) { UnsignedInt AbstractFont::glyphId(const char32_t character) {

5
src/Trade/AbstractImporter.cpp

@ -76,7 +76,10 @@ void AbstractImporter::doOpenFile(const std::string& filename) {
} }
void AbstractImporter::close() { void AbstractImporter::close() {
if(isOpened()) doClose(); if(isOpened()) {
doClose();
CORRADE_INTERNAL_ASSERT(!isOpened());
}
} }
Int AbstractImporter::defaultScene() { Int AbstractImporter::defaultScene() {

Loading…
Cancel
Save