Re: PHP extension - Saxon/C
| From: | O'Neil Delpratt | Date: | Mon, 25 Sep 2017 10:46:33 +0000 |
| Subject: | Re: PHP extension - Saxon/C | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-100770@lists.php.net to get a copy of this message | ||
Problem resolved. It was actually the following line I had still there: Z_ADDREF_P(oth);
> On 25 Sep 2017, at 11:36, O'Neil Delpratt <oneil@saxonica.com> wrote:
>
> Ok. Thanks for taking a look.
>
> Potenial problem could be the following line:
>
> const char * objName =ZSTR_VAL(Z_OBJCE_P(oth)->name);
>
>
> I think I need to free the objName some how.
>
>
>> On 22 Sep 2017, at 18:42, Sara Golemon <pollita@php.net> wrote:
>>
>>>> On Fri, Sep 22, 2017 at 12:21 PM, O'Neil Delpratt <oneil@saxonica.com>
>>>> wrote:
>>>> I still have the memory leak without that line. I think I was thinking I need to
>>>> add a refcount to the XdmNode object, but maybe I am wrong.
>>>>
>>> The Following gives leak:
>>>
>>> $proc = Saxon/SaxonProcessor
>>>
>>> $xquery = $proc->NewXQueryProcessor()
>>>
>>> $sourceNode = $proc->parseXmlFromString("<foo />”);
>>>
>>> $xquery->setContextItem($sourceNode); // with this line commented out there is no
>>> leak.
>>>
>> Okay, well the bad news is that assuming the extension you're working
>> with is the link you gave initially and you did remove the
>> Z_ADDREF_P() from XQueryProcessor::setContextItem()... I can't point
>> to why you'd have a memory leak.
>>
>> -Sara
>
>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>