[Pidgin] #10641: perl add_choice adds same choices within a loop

Pidgin trac at pidgin.im
Thu Dec 10 00:04:30 EST 2009


#10641: perl add_choice adds same choices within a loop
--------------------+-------------------------------------------------------
 Reporter:  rlazur  |        Owner:  deryni 
     Type:  defect  |       Status:  new    
Milestone:          |    Component:  plugins
  Version:  2.6.3   |   Resolution:         
 Keywords:  perl    |  
--------------------+-------------------------------------------------------

Comment(by rlazur):

 Putting it a little differently... If I do this, instead of empty strings,
 I sometimes get random garbage strings, which are different for each time
 I click plugin preferences. This makes me think there's an issue with a
 pointer somewhere in the plugin code. I think it's using garbage memory.

 {{{
       my $len = scalar(@files);
       my @fortunes;
       my $fort;
       my $choice;
       for (my $i=0; $i<$len; $i++) {
         if ($files[$i] =~ /^([A-Za-z0-9\-\_]+)$/) {
           push(@fortunes, $1);
         }
       }
       foreach $fort (@fortunes) {
         $choice = $fort;
         $fpref->add_choice($choice, $choice);
         Purple::Debug::info("Fortune Plugin", "my choice =
 ".$choice."\n");
       }
 }}}

-- 
Ticket URL: <http://developer.pidgin.im/ticket/10641#comment:4>
Pidgin <http://pidgin.im>
Pidgin


More information about the Tracker mailing list