[Kde-bindings] KDE/kdebindings/csharp/qyoto

Arno Rehn kde at arnorehn.de
Tue Nov 25 21:16:04 UTC 2008


SVN commit 889047 by arnorehn:

* Try initializing the smoke modules when creating a SmokeInvocation instance.

CCMAIL: kde-bindings at kde.org



 M  +4 -0      ChangeLog  
 M  +11 -7     src/SmokeInvocation.cs  


--- trunk/KDE/kdebindings/csharp/qyoto/ChangeLog #889046:889047
@@ -1,3 +1,7 @@
+2008-11-25  Arno Rehn  <arno at arnorehn.de>
+
+	* Try initializing the smoke modules when creating a SmokeInvocation instance.
+
 2008-10-25  Arno Rehn  <arno at arnorehn.de>
 
 	* Use List<IQGraphicsItem> instead of List<QGraphicsItem> and check for
--- trunk/KDE/kdebindings/csharp/qyoto/src/SmokeInvocation.cs #889046:889047
@@ -422,16 +422,18 @@
 				return;
 			Qyoto.Init_qyoto();
 			SmokeMarshallers.SetUp();
-			
-			// initialize other referenced smoke bindings
-			foreach (Assembly a in AppDomain.CurrentDomain.GetAssemblies()) {
-				AssemblySmokeInitializer attr = (AssemblySmokeInitializer) Attribute.GetCustomAttribute(a, typeof(AssemblySmokeInitializer));
-				if (attr != null) attr.CallInitSmoke();
-				InitializedAssemblies.Add(a);
-			}
 			runtimeInitialized = true;
 		}
 
+		public static void TryInitialize(Assembly assembly) {
+			if (InitializedAssemblies.Contains(assembly))
+				return;
+			AssemblySmokeInitializer attr = 
+				(AssemblySmokeInitializer) Attribute.GetCustomAttribute(assembly, typeof(AssemblySmokeInitializer));
+			if (attr != null) attr.CallInitSmoke();
+			InitializedAssemblies.Add(assembly);
+		}
+
 		static SmokeInvocation() {
 			InitRuntime();
 		}
@@ -449,6 +451,8 @@
 			instance = obj;
 			className = SmokeMarshallers.SmokeClassName(klass);
 
+			TryInitialize(klass.Assembly);
+
 			if (!globalMethodIdCache.TryGetValue(classToProxy, out methodIdCache)) {
 				methodIdCache = new Dictionary<string, ModuleIndex>();
 				globalMethodIdCache[classToProxy] = methodIdCache;



More information about the Kde-bindings mailing list