Skip to content

Commit 36aeb8d

Browse files
committed
At least make it look consistent
1 parent 21e7ed5 commit 36aeb8d

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/net45/WampSharp/WAMP2/V2/Client/Session/WampSessionClient.cs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,19 +104,22 @@ public void Welcome(long session, WelcomeDetails details)
104104

105105
public void Abort(AbortDetails details, string reason)
106106
{
107-
TrySetCloseEventArgs(SessionCloseType.Abort, details, reason);
108-
((IDisposable)mServerProxy).Dispose();
107+
using (IDisposable proxy = mServerProxy as IDisposable)
108+
{
109+
TrySetCloseEventArgs(SessionCloseType.Abort, details, reason);
110+
}
109111
}
110112

111113
public void Goodbye(GoodbyeDetails details, string reason)
112114
{
113-
if (!mGoodbyeSent)
115+
using (IDisposable proxy = mServerProxy as IDisposable)
114116
{
115-
mServerProxy.Goodbye(new GoodbyeDetails(), WampErrors.GoodbyeAndOut);
117+
if (!mGoodbyeSent)
118+
{
119+
mServerProxy.Goodbye(new GoodbyeDetails(), WampErrors.GoodbyeAndOut);
120+
}
116121
}
117122

118-
((IDisposable)mServerProxy).Dispose();
119-
120123
TrySetCloseEventArgs(SessionCloseType.Goodbye, details, reason);
121124
}
122125

0 commit comments

Comments
 (0)