+removeFromDLLPath
authorClaus Gittinger <cg@exept.de>
Mon, 09 Jun 2008 20:49:09 +0200
changeset 11053 bcf4ebb25868
parent 11052 0c44bf26275c
child 11054 e944cb72a955
+removeFromDLLPath
ExternalLibraryFunction.st
--- a/ExternalLibraryFunction.st	Mon Jun 09 20:47:41 2008 +0200
+++ b/ExternalLibraryFunction.st	Mon Jun 09 20:49:09 2008 +0200
@@ -111,7 +111,12 @@
 addToDllPath:aDirectoryPathName
     "can be used during initialization, to add more places for dll-loading"
 
-    DLLPATH := self dllPath asOrderedCollection copyWith:aDirectoryPathName
+    |oldPath|
+
+    oldPath := self dllPath.
+    (oldPath includes:aDirectoryPathName) ifFalse:[
+        self dllPath:(oldPath asOrderedCollection copyWith:aDirectoryPathName)
+    ]
 !
 
 dllPath
@@ -143,6 +148,23 @@
     "
 
     "Modified: / 03-10-2006 / 21:27:47 / cg"
+!
+
+removeFromDllPath:aDirectoryPathName
+    "remove added places from dll-loading"
+
+    |oldPath|
+
+    oldPath := self dllPath.
+    self dllPath:(oldPath asOrderedCollection copyWithout:aDirectoryPathName)
+
+    "
+     self dllPath.
+     self addToDllPath:'C:\aaa\bbb'.   
+     self dllPath.
+     self removeFromDllPath:'C:\aaa\bbb'.
+     self dllPath.
+    "
 ! !
 
 !ExternalLibraryFunction class methodsFor:'constants'!
@@ -1339,7 +1361,7 @@
 !ExternalLibraryFunction class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ExternalLibraryFunction.st,v 1.63 2008-06-09 18:40:14 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ExternalLibraryFunction.st,v 1.64 2008-06-09 18:49:09 cg Exp $'
 ! !
 
 ExternalLibraryFunction initialize!