       (illegal-argument "Plugin didn't provide an unload-hook and can therefore not be unloaded."))
     (dosync
      (alter (loaded-plugins plugin-manager) disj plugin))
-    (unload-hook)))
+    (unload-hook (base-frame plugin-manager))))
 
 (defn unregister-plugin
   "Unregisters a plugin from a plugin manager."

    :load-hook fn-called-when-plugin-is-loaded
    :unload-hook fn-called-when-plugin-is-unloaded)

  whereas the :unload-hook is optional."
  [name & hooks]
  (let [hooks (apply hash-map hooks)]
    (if (not (contains? hooks :load-hook))

    (illegal-argument "Plugin already be loaded."))
  (dosync
   (alter (loaded-plugins) conj plugin))
  ((load-hook plugin) (base-frame plugin-manager)))

(defn unload-plugin
  "Unloads a plugin from a plugin manager."
