Skip to content

Commit 9619661

Browse files
committed
client destroy method will call SmithyClient destroy by default
1 parent edca7f6 commit 9619661

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/ServiceGenerator.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,8 @@ private void generateDestroyMethod() {
324324
// Generates the destroy() method, and calls the destroy() method of
325325
// any runtime plugin that claims to have a destroy method.
326326
writer.openBlock("destroy(): void {", "}", () -> {
327+
// Always call destroy() in SmithyClient class. By default, it's optional.
328+
writer.write("super.destroy();");
327329
writer.pushState(CLIENT_DESTROY_SECTION);
328330
for (RuntimeClientPlugin plugin : runtimePlugins) {
329331
plugin.getDestroyFunction().ifPresent(destroy -> {

0 commit comments

Comments
 (0)