evolution-sharp r174 - in trunk: . evolution/src



Author: jjohnny
Date: Tue Apr 29 14:56:53 2008
New Revision: 174
URL: http://svn.gnome.org/viewvc/evolution-sharp?rev=174&view=rev

Log:
Fix for #519284. Tell GC not to free const char*. Fixed Uid & Location properties



Modified:
   trunk/ChangeLog
   trunk/evolution/src/CalComponent.cs

Modified: trunk/evolution/src/CalComponent.cs
==============================================================================
--- trunk/evolution/src/CalComponent.cs	(original)
+++ trunk/evolution/src/CalComponent.cs	Tue Apr 29 14:56:53 2008
@@ -181,15 +181,17 @@
 		}
 
 		[DllImport("ecal")]
-			static extern void e_cal_component_get_uid (IntPtr handle, out string uid);
+			static extern void e_cal_component_get_uid (IntPtr handle, out IntPtr uid);
 		[DllImport("ecal")]
 			static extern void e_cal_component_set_uid (IntPtr handle, string uid);
 		
 		public string Uid {
 			get {
-				string uid = "";
-				e_cal_component_get_uid (Handle, out uid);
-				return uid;
+				IntPtr uid;
+			    	e_cal_component_get_uid (Handle, out uid);
+			    	string managed_uid = Marshal.PtrToStringAnsi (uid);
+
+			    	return managed_uid;
 			}
 			set {
 				e_cal_component_set_uid (Handle, value);
@@ -271,15 +273,17 @@
 		}
 
 		[DllImport("ecal")]
-			static extern void e_cal_component_get_location (IntPtr raw, out string location);
+			static extern void e_cal_component_get_location (IntPtr raw, out IntPtr location);
 		[DllImport("ecal")]
 			static extern void e_cal_component_set_location (IntPtr raw, string location);
 
 		public string Location {
 			get {
-				string location = "";
+				IntPtr location;
 				e_cal_component_get_location (Handle, out location);
-				return location;
+				string managed_location = Marshal.PtrToStringAnsi (location);
+
+				return managed_location;
 			}
 			set {
 				e_cal_component_set_location (Handle, value);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]