Add hacky destructor to UConverter to prevent infinite recursion
commit7797cc1fab4ad303771a63acf0ae513edf79f50f
authorAlex Malyshev <alexanderm@fb.com>
Tue, 15 Apr 2014 01:31:16 +0000 (14 18:31 -0700)
committerSara Golemon <sgolemon@fb.com>
Tue, 15 Apr 2014 16:30:20 +0000 (15 09:30 -0700)
tree5fc9129ae3a79c08cd8618c2d58422cfb178f0c9
parent9886de4a25a921d9c9c6f3373e78ed838d2e4195
Add hacky destructor to UConverter to prevent infinite recursion

IntlUConverter is the native data for UConverter, and ~IntlUConverter
runs user callbacks that ultimately access the UConverter ObjectData,
which will rerun ~ObjectData and we go into a cycle. Run the callbacks
in UConverter::__destruct instead.

Breaks compat with PHP5, as UConverter is not supposed to have a
destructor defined. Not intended to be permanent.

The real fix is to have a better story with how native data objects are
destroyed. Mandating that they always get destroyed after their
associated ObjectData isn't going to work if we want to fully match PHP5.

Reviewed By: @ptarjan

Differential Revision: D1273255
hphp/runtime/ext/icu/ext_icu_uconverter.cpp
hphp/runtime/ext/icu/ext_icu_uconverter.h
hphp/runtime/ext/icu/ext_icu_uconverter.php
hphp/test/slow/u_converter/2135.php
hphp/test/zend/good/ext/intl/tests/uconverter_oop_callback.php.expectf
hphp/test/zend/good/ext/intl/tests/uconverter_oop_callback.php.skipif [new file with mode: 0644]
hphp/test/zend/good/ext/intl/tests/uconverter_oop_callback_return.php.skipif [new file with mode: 0644]