Skip to content
This repository has been archived by the owner on Dec 16, 2019. It is now read-only.

Commit

Permalink
return address for unset properties
Browse files Browse the repository at this point in the history
  • Loading branch information
krakjoe committed Jan 23, 2013
1 parent 6a0b4fd commit 01ceeac
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/store.c
Expand Up @@ -142,11 +142,11 @@ int pthreads_store_read(pthreads_store store, char *key, int keyl, zval **read T
if (pthreads_lock_acquire(store->lock, &locked TSRMLS_CC)) {
pthreads_storage *storage = NULL;
if (zend_ts_hash_find(&store->table, key, keyl, (void**)&storage)==SUCCESS && storage) {
ALLOC_INIT_ZVAL(*read);
MAKE_STD_ZVAL(*read);
if ((result = pthreads_store_convert((*storage), *read TSRMLS_CC))!=SUCCESS) {
FREE_ZVAL(*read);
} else Z_SET_REFCOUNT_PP(read, 0);
}
} else MAKE_STD_ZVAL(*read);
pthreads_lock_release(store->lock, locked TSRMLS_CC);
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/corrupted-resources.phpt
Expand Up @@ -31,7 +31,7 @@ $test->start();
Work Object
(
)
object(Work)#3 (0) {
object(Work)#4 (0) {
}
resource(2) of type (stream)
resource(2) of type (stream)
Expand Down
1 change: 1 addition & 0 deletions tests/unset-defaults.phpt
Expand Up @@ -16,3 +16,4 @@ $thread = new TestThread();
$thread->start();
?>
--EXPECT--
NULL

0 comments on commit 01ceeac

Please sign in to comment.