Ver código fonte

2006-03-21 Sebastien Pouliot <[email protected]>

	* PrintingServicesUnix.cs: cupsGetPrinters(char***) requires to free 
	each individual string and (finally) the list. Note that this call is
	deprecated.


svn path=/trunk/mcs/; revision=58270
Sebastien Pouliot 20 anos atrás
pai
commit
a91b0dc4ef

+ 6 - 0
mcs/class/System.Drawing/System.Drawing.Printing/ChangeLog

@@ -1,3 +1,9 @@
+2006-03-21  Sebastien Pouliot  <[email protected]>
+
+	* PrintingServicesUnix.cs: cupsGetPrinters(char***) requires to free 
+	each individual string and (finally) the list. Note that this call is
+	deprecated.
+
 2006-03-13  Peter Dennis Bartok  <[email protected]>
 
 	* PrintingServicesUnix.cs: Handle not having a printer

+ 2 - 0
mcs/class/System.Drawing/System.Drawing.Printing/PrintingServicesUnix.cs

@@ -164,12 +164,14 @@ namespace System.Drawing.Printing
 				string str;
 				PrinterSettings.StringCollection col = new PrinterSettings.StringCollection (new string[] {});
 
+				/* FIXME: call is deprecated */
 				n_printers = cupsGetPrinters (ref printers);
 
 				ptr_printers = printers;
 				for (int i = 0; i < n_printers; i++) {
 					ptr_printer = (IntPtr) Marshal.ReadInt32 (ptr_printers);
 					str = Marshal.PtrToStringAnsi (ptr_printer);
+					Marshal.FreeHGlobal (ptr_printer);
 					ptr_printers = new IntPtr (ptr_printers.ToInt64 () + 4);
 					col.Add (str);
 				}