Skip to content

Clarification of msgfree when used with next_changed_entries in doc #54

@macrotex

Description

@macrotex

I would suggest you add the call to msgfree to the code fragment in the documentation for next_changed_entries. I had the msgfree OUTSIDE the loop because I was worried that msgfree would mess up the ldap object's listening. To avoid other users making that sort of mistake in the future, adding the msgfree call in the documentation for next_changed_entries would be helpful.

In other words, change this

   while(1) {
       while( @entries = $ld->next_changed_entries($msgid, 0, -1) ) {
           foreach $entry (@entries) {
               print "entry dn is <".$ld->get_dn($entry->{'entry'})."> ".
                   $entry->{'state'}."\n";
           }
       }
   }

to this

   while(1) {
       while( @entries = $ld->next_changed_entries($msgid, 0, -1) ) {
           foreach $entry (@entries) {
               print "entry dn is <".$ld->get_dn($entry->{'entry'})."> ".
                   $entry->{'state'}."\n";
           }
           $ld->msgfree();
       }
   }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions