kohabug 2225 - fix resource leak in SimpleSearch
authorGalen Charlton <galen.charlton@liblime.com>
Fri, 6 Jun 2008 23:15:23 +0000 (18:15 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Mon, 9 Jun 2008 11:38:06 +0000 (06:38 -0500)
commitaf14b082e462e0660420b3fa3c5c9efd85c349fe
tree047141ea4dc610ed94c5f965afec16f39fa4e09f
parent0694499c947d3a06433287fcea1388044bb3a783
kohabug 2225 - fix resource leak in SimpleSearch

Explicitly destroy ZOOM Query and ResultSet objects created
in C4::Search::SimpleSearch() - for long-running users
of SimpleSearch, such as link_bibs_to_authorities.pl or
the matcher used by the staging MARC import, the failure
to do this causes a memory leak in both the client Perl
script and (in the case of ZOOM ResultSet objects) a
corresponding resource leak in zebrasrv for the life
of the Z39.50 connection.

With this change, link_bibs_to_authorities.pl will be
be able to process large bib datasets without leaking
memory due to the Z39.50 lookups it does.

Similar changes are indicated for all uses of
ZOOM that could last longer than a single CGI
query.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/Search.pm