DISCLAIMER: I played 2 hours with carbon in total
It happens to me that the test app I put togheter(not using xcode) for
trying growl from C crashes instantly like this..
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000005
0x908f92b4 in CFRetain ()
(gdb) where
#0 0x908f92b4 in CFRetain ()
#1 0xc00044fb in Growl_RegisterWithDictionary ()
#2 0xc000472d in Growl_SetDelegate ()
..
Apparently my thing hasn´t had the GROWL_APP_ID set in any place (And
I was not passing it explicitly).. but the application bridge shouldn
´t crash by that! should it? This fixed it on My box, when I´m
steering the screen.
bash-3.2$ diff -Nru Growl-1.1.4-src-orig/ Growl-1.1.4-src
diff -Nru Growl-1.1.4-src-orig/Framework/Source/GrowlApplicationBridge-
Carbon.c Growl-1.1.4-src/Framework/Source/GrowlApplicationBridge-
Carbon.c
--- Growl-1.1.4-src-orig/Framework/Source/GrowlApplicationBridge-
Carbon.c 2009-02-12 14:03:34.000000000 -0200
+++ Growl-1.1.4-src/Framework/Source/GrowlApplicationBridge-Carbon.c
2009-02-12 14:04:01.000000000 -0200
@@ -616,9 +616,14 @@
}
if ((!keys) || CFSetContainsValue(keys, GROWL_APP_ID))
- if (!CFDictionaryContainsKey(mRegDict, GROWL_APP_ID))
- CFDictionarySetValue(mRegDict, GROWL_APP_ID,
CFBundleGetIdentifier
(CFBundleGetMainBundle()));
-
+ if (!CFDictionaryContainsKey(mRegDict, GROWL_APP_ID)){
+ CFTypeRef app_id = CFBundleGetIdentifier
(CFBundleGetMainBundle());
+ if (!app_id){
+ app_id = CFStringCreateWithCString
(kCFAllocatorDefault, "com.growl.unknown", kCFStringEncodingASCII);
+ NSLog(CFSTR("GrowlApplicationBridge: Could not
determine GROWL_AP_ID from the registration dictionary nor the main
application bundle (using %@)."),app_id);
+ }
+ CFDictionarySetValue(mRegDict, GROWL_APP_ID,app_id);
+ }
return mRegDict;
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Growl Discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/growldiscuss?hl=en
-~----------~----~----~----~------~----~------~--~---