Edit report at https://bugs.php.net/bug.php?id=63121&edit=1
ID: 63121
Comment by: robert dot johnson at icap dot com
Reported by: robert dot johnson at icap dot com
Summary: enchant_broker_free_dict destroys broker resource
Status: Open
Type: Bug
Package: Enchant related
Operating System: Win XP SP 3
PHP Version: 5.4.7
Block user comment: N
Private report: N
New Comment:
Further testing reveals that Enchant broker resource is also destroyed when the
PWL dictionary resource goes out of scope.
Previous Comments:
------------------------------------------------------------------------
[2012-09-20 11:22:00] robert dot johnson at icap dot com
This code works, so bug is probably related to function
enchant_broker_request_pwl_dict():
if ( PHP_SAPI != 'cli' )
header('Content-Type:text/plain;charset=UTF-8');
$r = enchant_broker_init();
debug_zval_dump($r);
$d = enchant_broker_request_dict($r, 'en-gb');
enchant_broker_free_dict($d);
debug_zval_dump($r);
echo "End.\r\n";
Result:
resource(1) of type (enchant_broker) refcount(2)
resource(1) of type (enchant_broker) refcount(2)
End.
------------------------------------------------------------------------
[2012-09-20 11:11:30] robert dot johnson at icap dot com
Description:
------------
Calling enchant_broker_free_dict destroys the resource created by
enchant_broker_init(), instead of just the dictionary resource.
Test script:
---------------
if ( PHP_SAPI != 'cli' )
header('Content-Type:text/plain;charset=UTF-8');
$r = enchant_broker_init();
debug_zval_dump($r);
$d = enchant_broker_request_pwl_dict($r, 'c:\mydict.dic');
enchant_broker_free_dict($d);
debug_zval_dump($r);
echo "End.\r\n";
Expected result:
----------------
resource(1) of type (enchant_broker) refcount(2)
resource(1) of type (enchant_broker) refcount(2)
End.
Actual result:
--------------
resource(1) of type (enchant_broker) refcount(2)
resource(1) of type (Unknown) refcount(2)
End.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=63121&edit=1