VoodooPS2Controller > Bug Reports

[Solved] Preference pane settings do not save

<< < (4/4)

lebidou:
I had some spare time to spend on this today, so I looked at the Synapticonfigload errors.
Apparently, it comes from the lack of an autorelease pool requested by the NSStrings tmp1 and tmp2. I modified this according to sample codes (I'm not an objective C expert neither).

If someone with more Obj-C knowledge could take a look at the diff:


--- Code: ------ synapticsconfigload/synapticsconfigload.m 2009-02-16 10:54:14.000000000 +0100
+++ synapticsconfigload.m 2009-04-17 14:35:29.000000000 +0200
@@ -12,7 +12,6 @@
  CFDataRef dat;
  CFDictionaryRef plist;
  CFStringRef *keys;
- NSString *tmp1, *tmp2;
  CFTypeRef *vals;
  int i;
 
@@ -23,10 +22,20 @@
  return 1;
  }
 
- f=fopen ([tmp2=[NSHomeDirectory() stringByAppendingString:tmp1
- = [NSString stringWithCString: "/Library/Preferences/org.voodoo.SynapticsTouchpad.plist"]] UTF8String], "rb");
- CFRelease(tmp1);
- CFRelease(tmp2);
+ //There was no AutoreleasePool, here is the allocation and init
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+ NSString *tmp1, *tmp2;
+
+ //NSStrings Allocation and Initialization
+ tmp1 = [[NSString alloc] initWithCString:"/Library/Preferences/org.voodoo.SynapticsTouchpad.plist"];
+ tmp2 = [[NSString alloc] init];
+ tmp2 = [NSHomeDirectory() stringByAppendingString:tmp1];
+
+ f=fopen ([tmp2 UTF8String], "rb");
+
+ //We release the AutoreleasePool, this also releases tmp1 and tmp2
+ [pool release];
 
  if (!f)
  {

--- End code ---

I hope it helps.

cogombo:

--- Quote from: lebidou on April 16, 2009, 08:53:28 PM ---The problem seems to come from the LaunchAgent plist file.

I modified mine with Lingon to set the value RunAtLoad wich wasn't present in the original one. Attached it to let you test if works for everyone (Copy it in /Library/LaunchAgents).

It seems to work here.

--- End quote ---

SUPERB!! perfect!

psychov:
have the same thing after all recomendations of this thread. settings doesn't saves.
any ideas?

eXyr0w:
thank you, this thread helped me to save the preferences in voodoops2...

Navigation

[0] Message Index

[*] Previous page

Go to full version