[Kde-bindings] KDE/kdebindings/php/phpqt/src
Thomas Moenicke
tm at php-qt.org
Wed Oct 22 21:52:51 UTC 2008
SVN commit 874962 by moenicke:
* freeing target for static calls when destructing the MethodCall object
* increase refcount of return value
CCMAIL: kde-bindings at kde.org
M +8 -1 MethodCall.cpp
M +1 -0 MethodCall.h
--- trunk/KDE/kdebindings/php/phpqt/src/MethodCall.cpp #874961:874962
@@ -11,13 +11,15 @@
MethodCallBase(smoke,method,*sp),
_target(target),
_o(0),
- _retval(retval)
+ _retval(retval),
+ _staticCall( false )
{
if( target == 0 )
{
_target = (zval*) emalloc( sizeof(zval) );
_retval = (zval*) emalloc( sizeof(zval) );
Context::setStaticZVal( _target );
+ _staticCall = true;
}
if (PHPQt::SmokePHPObjectExists(_target))
@@ -38,6 +40,11 @@
MethodCall::~MethodCall()
{
delete[] _stack;
+ if( _staticCall )
+ {
+ efree( _target );
+ _retval->refcount++;
+ }
}
Marshall::Action
--- trunk/KDE/kdebindings/php/phpqt/src/MethodCall.h #874961:874962
@@ -22,6 +22,7 @@
int _items;
zval *&_retval;
smokephp_object * _o;
+ bool _staticCall;
};
#endif /*METHODCALL_H_*/
More information about the Kde-bindings
mailing list