Skip to content

Commit d2f13c2

Browse files
Pubnub Instance Destroy fix (#153)
* Fix for listeners when destroy is called * RemoveHttpClients condition
1 parent 60b601b commit d2f13c2

File tree

9 files changed

+37
-22
lines changed

9 files changed

+37
-22
lines changed

.pubnub.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
name: c-sharp
2-
version: "6.7.0"
2+
version: "6.8.0"
33
schema: 1
44
scm: github.com/pubnub/c-sharp
55
changelog:
6+
- date: 2022-08-10
7+
version: v6.8.0
8+
changes:
9+
- type: bug
10+
text: "Fixed Destroy() method when multiple Pubnub instances were in use."
611
- date: 2022-07-27
712
version: v6.7.0
813
changes:
@@ -665,7 +670,7 @@ features:
665670
- QUERY-PARAM
666671
supported-platforms:
667672
-
668-
version: Pubnub 'C#' 6.7.0
673+
version: Pubnub 'C#' 6.8.0
669674
platforms:
670675
- Windows 10 and up
671676
- Windows Server 2008 and up
@@ -675,7 +680,7 @@ supported-platforms:
675680
- .Net Framework 4.5
676681
- .Net Framework 4.6.1+
677682
-
678-
version: PubnubPCL 'C#' 6.7.0
683+
version: PubnubPCL 'C#' 6.8.0
679684
platforms:
680685
- Xamarin.Android
681686
- Xamarin.iOS
@@ -695,7 +700,7 @@ supported-platforms:
695700
- .Net Core
696701
- .Net 6.0
697702
-
698-
version: PubnubUWP 'C#' 6.7.0
703+
version: PubnubUWP 'C#' 6.8.0
699704
platforms:
700705
- Windows Phone 10
701706
- Universal Windows Apps
@@ -719,7 +724,7 @@ sdks:
719724
distribution-type: source
720725
distribution-repository: GitHub
721726
package-name: Pubnub
722-
location: https://github.com/pubnub/c-sharp/releases/tag/v6.7.0.0
727+
location: https://github.com/pubnub/c-sharp/releases/tag/v6.8.0.0
723728
requires:
724729
-
725730
name: ".Net"
@@ -1002,7 +1007,7 @@ sdks:
10021007
distribution-type: source
10031008
distribution-repository: GitHub
10041009
package-name: PubNubPCL
1005-
location: https://github.com/pubnub/c-sharp/releases/tag/v6.7.0.0
1010+
location: https://github.com/pubnub/c-sharp/releases/tag/v6.8.0.0
10061011
requires:
10071012
-
10081013
name: ".Net Core"
@@ -1361,7 +1366,7 @@ sdks:
13611366
distribution-type: source
13621367
distribution-repository: GitHub
13631368
package-name: PubnubUWP
1364-
location: https://github.com/pubnub/c-sharp/releases/tag/v6.7.0.0
1369+
location: https://github.com/pubnub/c-sharp/releases/tag/v6.8.0.0
13651370
requires:
13661371
-
13671372
name: "Universal Windows Platform Development"

CHANGELOG

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
v6.8.0 - August 10 2022
2+
-----------------------------
3+
- Fixed: fixed Destroy() method when multiple Pubnub instances were in use.
4+
15
v6.7.0 - July 27 2022
26
-----------------------------
37
- Modified: added support for Users/Spaces to GrantToken.

src/Api/PubnubApi/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
[assembly: AssemblyProduct("Pubnub C# SDK")]
1212
[assembly: AssemblyCopyright("Copyright © 2021")]
1313
[assembly: AssemblyTrademark("")]
14-
[assembly: AssemblyVersion("6.7.0.0")]
15-
[assembly: AssemblyFileVersion("6.7.0.0")]
14+
[assembly: AssemblyVersion("6.8.0.0")]
15+
[assembly: AssemblyFileVersion("6.8.0.0")]
1616
// Setting ComVisible to false makes the types in this assembly not visible
1717
// to COM components. If you need to access a type in this assembly from
1818
// COM, set the ComVisible attribute to true on that type.

src/Api/PubnubApi/PubnubApi.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313

1414
<PropertyGroup>
1515
<PackageId>Pubnub</PackageId>
16-
<PackageVersion>6.7.0.0</PackageVersion>
16+
<PackageVersion>6.8.0.0</PackageVersion>
1717
<Title>PubNub C# .NET - Web Data Push API</Title>
1818
<Authors>Pandu Masabathula</Authors>
1919
<Owners>PubNub</Owners>
2020
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
2121
<PackageIconUrl>http://pubnub.s3.amazonaws.com/2011/powered-by-pubnub/pubnub-icon-600x600.png</PackageIconUrl>
2222
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
2323
<RepositoryUrl>https://github.com/pubnub/c-sharp/</RepositoryUrl>
24-
<PackageReleaseNotes>Added support for Users/Spaces to GrantToken.</PackageReleaseNotes>
24+
<PackageReleaseNotes>Fixed Destroy() method when multiple Pubnub instances were in use.</PackageReleaseNotes>
2525
<PackageTags>Web Data Push Real-time Notifications ESB Message Broadcasting Distributed Computing</PackageTags>
2626
<!--<Summary>PubNub is a Massively Scalable Web Push Service for Web and Mobile Games. This is a cloud-based service for broadcasting messages to thousands of web and mobile clients simultaneously</Summary>-->
2727
<Description>PubNub is a Massively Scalable Web Push Service for Web and Mobile Games. This is a cloud-based service for broadcasting messages to thousands of web and mobile clients simultaneously</Description>

src/Api/PubnubApi/PubnubCoreBase.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2273,7 +2273,10 @@ protected bool DeleteLocalChannelGroupUserState(string channelGroup)
22732273

22742274
internal void EndPendingRequests()
22752275
{
2276-
SubscribeCallbackListenerList.Clear();
2276+
if (SubscribeCallbackListenerList.ContainsKey(PubnubInstance.InstanceId))
2277+
{
2278+
SubscribeCallbackListenerList[PubnubInstance.InstanceId].Clear();
2279+
}
22772280

22782281
RemoveChannelDictionary();
22792282
TerminatePendingWebRequest();
@@ -2314,8 +2317,11 @@ internal void EndPendingRequests()
23142317
ChannelGroupUserState[PubnubInstance.InstanceId].Clear();
23152318
}
23162319

2317-
RemoveHttpClients();
2318-
2320+
if (MultiChannelSubscribe.Count > 0 && MultiChannelSubscribe.Where(t => t.Value.Keys.Count > 0).Count() == 0
2321+
&& MultiChannelGroupSubscribe.Count > 0 && MultiChannelGroupSubscribe.Where(t => t.Value.Keys.Count > 0).Count() == 0)
2322+
{
2323+
RemoveHttpClients();
2324+
}
23192325
PubnubInstance = null;
23202326
}
23212327

@@ -2352,7 +2358,7 @@ internal static void RemoveHttpClients()
23522358
}
23532359
#endif
23542360
}
2355-
2361+
23562362
internal void TerminateCurrentSubscriberRequest()
23572363
{
23582364
string[] channels = GetCurrentSubscriberChannels();

src/Api/PubnubApiPCL/PubnubApiPCL.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414

1515
<PropertyGroup>
1616
<PackageId>PubnubPCL</PackageId>
17-
<PackageVersion>6.7.0.0</PackageVersion>
17+
<PackageVersion>6.8.0.0</PackageVersion>
1818
<Title>PubNub C# .NET - Web Data Push API</Title>
1919
<Authors>Pandu Masabathula</Authors>
2020
<Owners>PubNub</Owners>
2121
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
2222
<PackageIconUrl>http://pubnub.s3.amazonaws.com/2011/powered-by-pubnub/pubnub-icon-600x600.png</PackageIconUrl>
2323
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
2424
<RepositoryUrl>https://github.com/pubnub/c-sharp/</RepositoryUrl>
25-
<PackageReleaseNotes>Added support for Users/Spaces to GrantToken.</PackageReleaseNotes>
25+
<PackageReleaseNotes>Fixed Destroy() method when multiple Pubnub instances were in use.</PackageReleaseNotes>
2626
<PackageTags>Web Data Push Real-time Notifications ESB Message Broadcasting Distributed Computing</PackageTags>
2727
<!--<Summary>PubNub is a Massively Scalable Web Push Service for Web and Mobile Games. This is a cloud-based service for broadcasting messages to thousands of web and mobile clients simultaneously</Summary>-->
2828
<Description>PubNub is a Massively Scalable Web Push Service for Web and Mobile Games. This is a cloud-based service for broadcasting messages to thousands of web and mobile clients simultaneously</Description>

src/Api/PubnubApiUWP/PubnubApiUWP.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515

1616
<PropertyGroup>
1717
<PackageId>PubnubUWP</PackageId>
18-
<PackageVersion>6.7.0.0</PackageVersion>
18+
<PackageVersion>6.8.0.0</PackageVersion>
1919
<Title>PubNub C# .NET - Web Data Push API</Title>
2020
<Authors>Pandu Masabathula</Authors>
2121
<Owners>PubNub</Owners>
2222
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
2323
<PackageIconUrl>http://pubnub.s3.amazonaws.com/2011/powered-by-pubnub/pubnub-icon-600x600.png</PackageIconUrl>
2424
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
2525
<RepositoryUrl>https://github.com/pubnub/c-sharp/</RepositoryUrl>
26-
<PackageReleaseNotes>Added support for Users/Spaces to GrantToken.</PackageReleaseNotes>
26+
<PackageReleaseNotes>Fixed Destroy() method when multiple Pubnub instances were in use.</PackageReleaseNotes>
2727
<PackageTags>Web Data Push Real-time Notifications ESB Message Broadcasting Distributed Computing</PackageTags>
2828
<!--<Summary>PubNub is a Massively Scalable Web Push Service for Web and Mobile Games. This is a cloud-based service for broadcasting messages to thousands of web and mobile clients simultaneously</Summary>-->
2929
<Description>PubNub is a Massively Scalable Web Push Service for Web and Mobile Games. This is a cloud-based service for broadcasting messages to thousands of web and mobile clients simultaneously</Description>

src/Examples/PubnubApi.ConsoleExample/PubnubApi.ConsoleExample.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848
<Reference Include="Numbers, Version=1.8.2.0, Culture=neutral, PublicKeyToken=9cd62db60ea5554c, processorArchitecture=MSIL">
4949
<HintPath>..\..\packages\PeterO.Numbers.1.8.2\lib\net40\Numbers.dll</HintPath>
5050
</Reference>
51-
<Reference Include="Pubnub, Version=6.6.0.0, Culture=neutral, PublicKeyToken=dc66f52ce6619f44, processorArchitecture=MSIL">
52-
<HintPath>..\..\packages\Pubnub.6.6.0\lib\net48\Pubnub.dll</HintPath>
51+
<Reference Include="Pubnub, Version=6.7.0.0, Culture=neutral, PublicKeyToken=dc66f52ce6619f44, processorArchitecture=MSIL">
52+
<HintPath>..\..\packages\Pubnub.6.7.0\lib\net48\Pubnub.dll</HintPath>
5353
</Reference>
5454
<Reference Include="System" />
5555
<Reference Include="System.ComponentModel.Composition" />

src/Examples/PubnubApi.ConsoleExample/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<package id="PeterO.Cbor" version="4.5.2" targetFramework="net461" />
55
<package id="PeterO.Numbers" version="1.8.2" targetFramework="net461" />
66
<package id="PeterO.URIUtility" version="1.0.0" targetFramework="net461" />
7-
<package id="Pubnub" version="6.6.0" targetFramework="net48" />
7+
<package id="Pubnub" version="6.7.0" targetFramework="net48" />
88
<package id="System.Collections" version="4.0.11" targetFramework="net461" />
99
<package id="System.Diagnostics.Debug" version="4.0.11" targetFramework="net461" />
1010
<package id="System.Globalization" version="4.0.11" targetFramework="net461" />

0 commit comments

Comments
 (0)