summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/BLua.cc1
-rw-r--r--lib/Handle.cc10
2 files changed, 6 insertions, 5 deletions
diff --git a/lib/BLua.cc b/lib/BLua.cc
index 7ee0bc4..6c40cc3 100644
--- a/lib/BLua.cc
+++ b/lib/BLua.cc
@@ -476,7 +476,6 @@ int LuaStatics::destructor(lua_State * _L) {
return 0;
}
-
void LuaObject::pushdestruct(Lua * L) throw (GeneralException) {
if (pushed) {
throw GeneralException("Error: can't push destructor, object already pushed");
diff --git a/lib/Handle.cc b/lib/Handle.cc
index 84004b0..ca2c971 100644
--- a/lib/Handle.cc
+++ b/lib/Handle.cc
@@ -246,10 +246,12 @@ void Handle::close() throw (GeneralException) {
}
}
} else {
- int err = ::close(h);
- if (err) {
- throw GeneralException(String(_("Error during close: ")) + strerror(errno));
- }
+ if (!hFile) {
+ int err = ::close(h);
+ if (err) {
+ throw GeneralException(String(_("Error during close: ")) + strerror(errno));
+ }
+ }
}
}