Subject: BUG in FVWM::Module (perllib)

From: Scott Smedley <[email-masked]>
Date: Sun, 25 Apr 2004 02:21:47 +1000

Hi Mikhael,

I'm working on the FVWM::Tracker::WindowList code & I've discovered a
serious bug. In short calls to deleteHandlers() don't work. (handlers
still exist)

This becomes evident by checking the return value from the call to
FVWM::Module::deleteHandler().

===================================================================
RCS file: /home/cvs/fvwm/fvwm/perllib/FVWM/Tracker.pm,v
retrieving revision 1.8
diff -u -r1.8 Tracker.pm
--- Tracker.pm  25 Oct 2003 03:00:00 -0000      1.8
+++ Tracker.pm  24 Apr 2004 15:12:04 -0000
@@ -89,7 +89,13 @@
 
        foreach (@$handlerIds) {
                next unless defined delete $self->{handlerIds}->{$_};
-               $self->{module}->deleteHandler($_) if $self->{module};
+               if ($self->{module})
+               {
+                       if ($self->{module}->deleteHandler($_) != 1)
+                       {
+                               print(STDERR "Error deleting handler $_\n");
+                       }
+               }
        }
 }

FVWM::Module::deleteHandler() returns an error because the passed
array ref ($id) is actually a string. (The array ref gets implicitly
converted to a string when it's used as a key-value in a hash. I don't
know of a way to go from the string value of a ref to an actual ref.)

I think the remedy is to use an actual string for handler ids (so
FVWM::Module::addHandler returns "$type:$index" or similar). I'd code
this up myself but I'm concerned about the impact it will have on the
rest of perllib.

What do you think?

SCoTT. :)
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Mikhael Goikhman <[email-masked]>
Date: Sat, 24 Apr 2004 19:14:07 +0000

On 25 Apr 2004 02:21:47 +1000, Scott Smedley wrote:
> 
> I'm working on the FVWM::Tracker::WindowList code

Ok, this may be wiser than to wait for me to do it.
This tracker may manage objects of type FVWM::Window if needed.

> & I've discovered a serious bug. In short calls to deleteHandlers()
> don't work. (handlers still exist)

I think I fixed it, but please test.

Regards,
Mikhael.