Skip to content

PHP: fix of a bit of memory leak#22706

Merged
stanley-cheung merged 1 commit intogrpc:masterfrom
HannahShiSFB:fix-mem-leak
Apr 20, 2020
Merged

PHP: fix of a bit of memory leak#22706
stanley-cheung merged 1 commit intogrpc:masterfrom
HannahShiSFB:fix-mem-leak

Conversation

@HannahShiSFB
Copy link
Copy Markdown
Collaborator

@HannahShiSFB HannahShiSFB commented Apr 17, 2020

on #19737, addref() was added on user's request, it's a fix of #19721 "Missing addref on ChannelCredentials in Channel constructor causes segfault"
At that time, grpc-php-ext was using php_grpc_zend_hash_del() to delete 3 objects, including "credentials", from args_array, but "credentials" object was used later. After fix, addref(increase ref) and delete(decrease ref) as a pair, made it OK, no memory leak then.
Later on #20249, when the code was modified, php-ext stopped using php_grpc_zend_hash_del() any more. addref() is not needed any more.

@HannahShiSFB HannahShiSFB changed the title fix of a bit of memory leak PHP: fix of a bit of memory leak Apr 17, 2020
@stanley-cheung stanley-cheung self-assigned this Apr 17, 2020
@stanley-cheung stanley-cheung added kokoro:run lang/php release notes: no Indicates if PR should not be in release notes labels Apr 17, 2020
Copy link
Copy Markdown
Contributor

@stanley-cheung stanley-cheung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@stanley-cheung stanley-cheung merged commit 3c4096e into grpc:master Apr 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lang/php release notes: no Indicates if PR should not be in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants