wez Sat Oct 9 09:08:18 2004 EDT
Modified files:
/php-src/ext/com_dotnet com_typeinfo.c
Log:
Fix crash bug.
# how the f*** did this work in the first place!?
http://cvs.php.net/diff.php/php-src/ext/com_dotnet/com_typeinfo.c?r1=1.4&r2=1.5&ty=u
Index: php-src/ext/com_dotnet/com_typeinfo.c
diff -u php-src/ext/com_dotnet/com_typeinfo.c:1.4
php-src/ext/com_dotnet/com_typeinfo.c:1.5
--- php-src/ext/com_dotnet/com_typeinfo.c:1.4 Wed Mar 17 21:16:34 2004
+++ php-src/ext/com_dotnet/com_typeinfo.c Sat Oct 9 09:08:16 2004
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: com_typeinfo.c,v 1.4 2004/03/18 02:16:34 iliaa Exp $ */
+/* $Id: com_typeinfo.c,v 1.5 2004/10/09 13:08:16 wez Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -227,34 +227,35 @@
PHPAPI ITypeLib *php_com_load_typelib_via_cache(char *search_string,
int codepage, int *cached TSRMLS_DC)
{
- ITypeLib **TL;
+ ITypeLib **TLp;
+ ITypeLib *TL;
char *name_dup;
int l;
l = strlen(search_string);
if (zend_ts_hash_find(&php_com_typelibraries, search_string, l+1,
- (void**)&TL) == SUCCESS) {
+ (void**)&TLp) == SUCCESS) {
*cached = 1;
/* add a reference for the caller */
- ITypeLib_AddRef(*TL);
- return *TL;
+ ITypeLib_AddRef(*TLp);
+ return *TLp;
}
*cached = 0;
name_dup = estrndup(search_string, l);
- *TL = php_com_load_typelib(name_dup, codepage TSRMLS_CC);
+ TL = php_com_load_typelib(name_dup, codepage TSRMLS_CC);
efree(name_dup);
- if (*TL) {
+ if (TL) {
if (SUCCESS == zend_ts_hash_update(&php_com_typelibraries,
- search_string, l+1, (void*)*TL, sizeof(ITypeLib*),
NULL)) {
+ search_string, l+1, (void*)TL, sizeof(ITypeLib*),
NULL)) {
/* add a reference for the hash table */
- ITypeLib_AddRef(*TL);
+ ITypeLib_AddRef(TL);
}
}
- return *TL;
+ return TL;
}
ITypeInfo *php_com_locate_typeinfo(char *typelibname, php_com_dotnet_object *obj,
char *dispname, int sink TSRMLS_DC)
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php