Page 1 of 1

1.1.4 Recovered files still show up in my trash

Posted: Thu Jun 19, 2008 9:56 pm
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?

Re: 1.1.4 Recovered files still show up in my trash

Posted: Sun Mar 29, 2009 9:52 am
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.

Re: 1.1.4 Recovered files still show up in my trash

Posted: Sat Apr 18, 2009 2:18 am
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).

Re: 1.1.4 Recovered files still show up in my trash

Posted: Sat Jun 06, 2009 12:27 pm
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?

Re: 1.1.4 Recovered files still show up in my trash

Posted: Sat Aug 01, 2009 9:07 am
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.

Re: 1.1.4 Recovered files still show up in my trash

Posted: Wed Nov 04, 2009 2:20 pm
by imaria
In 1.2, this is still happening.

Any updates from the developers? This has been going on for a shockingly long time.

Re: 1.1.4 Recovered files still show up in my trash

Posted: Wed Nov 04, 2009 2:26 pm
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.

Re: 1.1.4 Recovered files still show up in my trash

Posted: Wed Nov 04, 2009 2:32 pm
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.

Re: 1.1.4 Recovered files still show up in my trash

Posted: Wed Nov 04, 2009 3:00 pm
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.

Re: 1.1.4 Recovered files still show up in my trash

Posted: Wed Nov 04, 2009 6:07 pm
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?

Re: 1.1.4 Recovered files still show up in my trash

Posted: Wed Nov 04, 2009 10:31 pm
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.