1.1.4 Recovered files still show up in my trash

The Growl forums have moved to Google Groups, this forum is read only.
Locked
kerrala
Harmless
Posts: 1
Joined: Thu Jun 19, 2008 9:50 pm

1.1.4 Recovered files still show up in my trash

Post by kerrala »

Hi

I was having the same issues as others who were getting the 'regdict' files turning up in the trash after a reboot.
I thought that 1.1.3 was supposed to sort out this problem but I still have it.
I have tried uninstalling using both the manual method and the uninstaller and then running the package to install Growl 1.1.4 again but it does not appear to work.

I am on a G4 1.5 ghz Mac Mini using Leopard 10.5.3

Anyone have a solution?
Dorregaray
Harmless
Posts: 3
Joined: Sun Mar 29, 2009 9:04 am

Re: 1.1.4 Recovered files still show up in my trash

Post by Dorregaray »

I have written a growl notification plugin for Kadu IM using Carbon API and have the same problem.
My constructor setting the growl delegate looks:

Code: Select all

GrowlNotifier::GrowlNotifier(
	const QStringList& notifications, const QStringList& default_notifications,
	const QString& app)
{
	CFStringRef notification;
	
	// Initialize signaler
	signaler_ = new GrowlNotifierSignaler();

	// All Notifications
	QStringList::ConstIterator it;
	CFMutableArrayRef allNotifications = CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks);
	for (it = notifications.begin(); it != notifications.end(); ++it)
	{
		notification = qString2CFString(*it);
		CFArrayAppendValue(allNotifications, notification);
		CFRelease(notification);
	}

	// Default Notifications
	CFMutableArrayRef defaultNotifications = CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks);
	for (it = default_notifications.begin(); it != default_notifications.end(); ++it)
	{
		notification = qString2CFString(*it);
		CFArrayAppendValue(defaultNotifications, notification);
		CFRelease(notification);
	}
	
	// Initialize delegate
	InitGrowlDelegate(&delegate_);
	delegate_.applicationName = qString2CFString(app);

	CFTypeRef keys[] = { GROWL_NOTIFICATIONS_ALL, GROWL_NOTIFICATIONS_DEFAULT };
	CFTypeRef values[] = { allNotifications, defaultNotifications };

	delegate_.registrationDictionary = CFDictionaryCreate(
		kCFAllocatorDefault, keys, values, 2, 
		&kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);

	delegate_.growlNotificationWasClicked = &notification_clicked;
	delegate_.growlNotificationTimedOut = &notification_timeout;

	CFRelease(allNotifications);
	CFRelease(defaultNotifications);

	// Register with Growl
	Growl_SetDelegate(&delegate_);
}
I use Growl_NotifyWithTitleDescriptionNameIconPriorityStickyClickContext to display the notification.
The destructor is as follows:

Code: Select all

GrowlNotifier::~GrowlNotifier()
{
	delete signaler_;

	// Release delegate
	delegate_.release(&delegate_);

	// Release registration dictionary
	CFRelease(delegate_.registrationDictionary);
}
I think still I might have something not released which causes the regDict file to be recoverd after reboot.
Coud anyone can point me what I'm doing wrong? I'm the Linux programmer and I'm not familiar with carbon and cocoa so please be understanding. Thanks.
User avatar
boredzo
Cocoaforge Admin
Posts: 796
Joined: Mon Dec 06, 2004 7:49 am
Contact:

Re: 1.1.4 Recovered files still show up in my trash

Post by boredzo »

Dorregaray wrote:The destructor is as follows:

Code: Select all

	// Release delegate
	delegate_.release(&delegate_);
You're using this member wrong. You can set it to a function for GrowlApplicationBridge to call, but you don't call it yourself. Instead, call Growl_SetDelegate(NULL).
Dorregaray
Harmless
Posts: 3
Joined: Sun Mar 29, 2009 9:04 am

Re: 1.1.4 Recovered files still show up in my trash

Post by Dorregaray »

boredzo wrote:You're using this member wrong. You can set it to a function for GrowlApplicationBridge to call, but you don't call it yourself. Instead, call Growl_SetDelegate(NULL).
using Growl_SetDelegate(NULL) leads to crash so that was the only one solution for relasing the delegate.
However I've seen no sample code on the net using Growl_SetDelegate(NULL) or releasing the growl delegate so I'm not sure if I should do this.
According to the growl documentation the delegate should be released by growl after automatically but it isn't. Maybe the carbon bridge does not release it like cocoa one does?
Dorregaray
Harmless
Posts: 3
Joined: Sun Mar 29, 2009 9:04 am

Re: 1.1.4 Recovered files still show up in my trash

Post by Dorregaray »

I've checked 1.1.5 and 1.1.6 and the problem still exists...
boredzo wrote: You can set it to a function for GrowlApplicationBridge to call, but you don't call it yourself. Instead, call Growl_SetDelegate(NULL).
If you take a closer look at Growl_SetDelegate function when called with NULL parameter, you'll see that the line:

Code: Select all

CFStringRef appName = delegate->applicationName;
will lead to segfault. Probably the applicationName from old delegate should be used here when NULL new delegate is given.

However I see the problem in different place - in the function _launchGrowlIfInstalledWithRegistrationDictonary() there is a temporary file being created (see comment in line 884 of GrowlApplicationBridge-Carbon.c) but this file is never removed. Am I right? And this is the file which appears in Trash after reboot the system.
User avatar
imaria
Harmless
Posts: 6
Joined: Sat Jun 07, 2008 4:12 am

Re: 1.1.4 Recovered files still show up in my trash

Post by imaria »

In 1.2, this is still happening.

Any updates from the developers? This has been going on for a shockingly long time.
User avatar
boredzo
Cocoaforge Admin
Posts: 796
Joined: Mon Dec 06, 2004 7:49 am
Contact:

Re: 1.1.4 Recovered files still show up in my trash

Post by boredzo »

imaria wrote:In 1.2, this is still happening.
It's up to application developers to update their frameworks (and to not use the now-deprecated Carbon version of the Growl API).

Make sure you're using the current versions of your applications. If you are, lobby their developers to update their Growl frameworks and (if applicable) switch to the Cocoa-based Growl API.
User avatar
imaria
Harmless
Posts: 6
Joined: Sat Jun 07, 2008 4:12 am

Re: 1.1.4 Recovered files still show up in my trash

Post by imaria »

Is there any way to trawl through the growlRegDict files or the console to determine which applications are at fault? I have a few likely suspects in mind, but I'm concerned it may be more than one application using old frameworks.
User avatar
boredzo
Cocoaforge Admin
Posts: 796
Joined: Mon Dec 06, 2004 7:49 am
Contact:

Re: 1.1.4 Recovered files still show up in my trash

Post by boredzo »

imaria wrote:Is there any way to trawl through the growlRegDict files … to determine which applications are at fault?
Yes. You can open them in Property List Editor, or a text editor.
User avatar
imaria
Harmless
Posts: 6
Joined: Sat Jun 07, 2008 4:12 am

Re: 1.1.4 Recovered files still show up in my trash

Post by imaria »

Blergh, it turns out the culprit is BBEdit. I don't suppose there's a way I can just swap out the Growl.framework inside the application with a newer one?
User avatar
boredzo
Cocoaforge Admin
Posts: 796
Joined: Mon Dec 06, 2004 7:49 am
Contact:

Re: 1.1.4 Recovered files still show up in my trash

Post by boredzo »

imaria wrote:Blergh, it turns out the culprit is BBEdit. I don't suppose there's a way I can just swap out the Growl.framework inside the application with a newer one?
You can try it, but I'm pretty sure we haven't fixed this one in our Carbon API, so it wouldn't help.

Also, there's a new version of BBEdit today (link via the Daring Fireball Linked List), so I suggest updating the whole app first.
Locked