evolution-sharp r173 - in branches/EVOLUTION_SHARP_0_16_0: . evolution/src



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

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


Modified:
   branches/EVOLUTION_SHARP_0_16_0/ChangeLog
   branches/EVOLUTION_SHARP_0_16_0/evolution/src/CalComponent.cs

Modified: branches/EVOLUTION_SHARP_0_16_0/evolution/src/CalComponent.cs
==============================================================================
--- branches/EVOLUTION_SHARP_0_16_0/evolution/src/CalComponent.cs	(original)
+++ branches/EVOLUTION_SHARP_0_16_0/evolution/src/CalComponent.cs	Tue Apr 29 14:45:47 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]