Thanks!

I am only squashing this in:

diff --git a/packages/dbd-postgresql/Connection.st 
b/packages/dbd-postgresql/Connection.st
index 202e604..d2222ec 100644
--- a/packages/dbd-postgresql/Connection.st
+++ b/packages/dbd-postgresql/Connection.st
@@ -198,11 +198,11 @@ CObject subclass: PQConnection [
             ^ self error: 'All parameters must be strings here'].
 
         "Convert the params into an array of C-Strings."
-        par := CStringType new: params size.
+        ^[par := CStringType new: params size.
         1 to: params size do: [:each |
             par at: each - 1 put: (params at: each)].
 
-        [^ self
+        self
             exec_params:aSqlStatement
             n_par: params size
             types: nil
@@ -213,9 +213,9 @@ CObject subclass: PQConnection [
         ] ensure: [
             "Free the memory we allocated"
 
-            0 to: params size - 1 do: [:each |
-                (par derefAt: (each * CStringType sizeof) type: CObjectType) 
free
-            ].
+            par isNil ifFalse: [
+                0 to: params size - 1 do: [:each |
+                    ((par + each) derefAt: 0 type: CObjectType) free ].
 
             par free.
         ]

I'll probably add a utility method to CPtr for the derefAt:type: idiom.

Paolo

_______________________________________________
help-smalltalk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

Reply via email to