move check for gimp and firefox to when needed, to allow soft require
[booh] / lib / booh / Synchronizator.rb
index 322630196428495c99accaedaa977ae39a100e9f..35bd115f044a377d0d8707a020a1fe50201fc769 100644 (file)
@@ -41,12 +41,13 @@ class ObjectWrapper
 end
 
 class Synchronizator < ObjectWrapper
-    def initialize(wrapped_object)
-        super
-        @__wrapped_object.extend(MonitorMixin)
+    def initialize(wrapped_object, monitor_object)
+        super(wrapped_object)
+        @__monitor_object = monitor_object
+        @__monitor_object.extend(MonitorMixin)
     end
     def __wrap(id, *args, &block)
-        @__wrapped_object.synchronize {
+        @__monitor_object.synchronize {
             super(id, *args, &block)
         }
     end