Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the issue that the ReferenceConfigCache#destroy method does not call proxy.$destroy() #8065

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -175,7 +175,8 @@ public void destroy(String key, Class<?> type) {

Map<String, Object> proxiesOftype = proxies.get(type);
if (CollectionUtils.isNotEmptyMap(proxiesOftype)) {
proxiesOftype.remove(key);
Destroyable proxy = (Destroyable) proxiesOftype.remove(key);
Copy link
Member

Choose a reason for hiding this comment

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

it would be better to check if the object is an instance of Destroyable first

Copy link
Member Author

@BurningCN BurningCN Jun 21, 2021

Choose a reason for hiding this comment

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

The generated proxy instances all automatically implement the Destroyable interface, right?

image
image

proxy.$destroy();
if (proxiesOftype.isEmpty()) {
proxies.remove(type);
}
Expand Down