]> git.jsancho.org Git - guile-irrlicht.git/commitdiff
drop refactor
authorJavier Sancho <jsf@jsancho.org>
Wed, 11 Mar 2020 16:58:41 +0000 (17:58 +0100)
committerJavier Sancho <jsf@jsancho.org>
Wed, 11 Mar 2020 16:58:41 +0000 (17:58 +0100)
src/IReferenceCounted.cpp

index b7878213c61be0402de528541222a1b4918e23c4..0038d1859c7b637b3fd122bd74ff6d2c2fee64ba 100644 (file)
@@ -36,16 +36,12 @@ extern "C" {
   SCM
   irr_drop (SCM wrapped_obj)
   {
+    bool result = 0;
     if (device_p (wrapped_obj))
       {
-        irr::IrrlichtDevice* obj = unwrap_device (wrapped_obj);
-        return scm_from_bool (obj->drop ());
-      }
-    else
-      {
-        irr::IReferenceCounted* obj = (irr::IReferenceCounted*)scm_foreign_object_ref (wrapped_obj, 0);
-        return scm_from_bool (obj->drop ());
+        result = unwrap_device (wrapped_obj)->drop ();
       }
+    return scm_from_bool (result);
   }
 
 }