troydavisson/PHRETS — pull request #32 by chelseau (2014-01-28 08:33:12+00:00)
Title: Call FreeResult after there are no more rows to return in FetchRow

This pull request is to fix a memory leak with the Search function.

The Search() function doesn't return $int_result_pointer (allowing the result to be freed externally), or free the memory it's using.

So if Search is being called numerous times (example where this becomes an issue: retrieving media records for each active listing on a large feed), the internal arrays start to eat up a lot of memory.

This change calls FreeResult if $field_data is empty in FetchRow (aka there's no more data)

This is in regards to https://github.com/troydavisson/PHRETS/issues/23