Skip to content

Commit d786016

Browse files
committed
Bugfix in channel unsubscribe.
1 parent 7af4e25 commit d786016

File tree

10 files changed

+16
-16
lines changed

10 files changed

+16
-16
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# WebsocketRailsClient++ (v0.7.4-NB)
1+
# WebsocketRailsClient++ (v0.7.5-NB)
22

33
WebsocketRailsClient++ is a C++ library that uses the implementation of RFC6455 (The WebSocket Protocol)
44
implemented in the WebSocket++ library, the Json++ light-weight JSON parser and the Boost library. It allows

websocket-rails-client/channel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
*
33
* Name : channel.cpp
4-
* Version : v0.7.4-NB
4+
* Version : v0.7.5-NB
55
* Description : Channel Class in C++, Ansi-style
66
* Author : Egon Zemmer
77
* Company : Phlegx Systems

websocket-rails-client/channel.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
*
33
* Name : channel.hpp
4-
* Version : v0.7.4-NB
4+
* Version : v0.7.5-NB
55
* Description : Channel Header Class in C++, Ansi-style
66
* Author : Egon Zemmer
77
* Company : Phlegx Systems

websocket-rails-client/event.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
*
33
* Name : event.cpp
4-
* Version : v0.7.4-NB
4+
* Version : v0.7.5-NB
55
* Description : Event Class in C++, Ansi-style
66
* Author : Egon Zemmer
77
* Company : Phlegx Systems

websocket-rails-client/event.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
*
33
* Name : event.hpp
4-
* Version : v0.7.4-NB
4+
* Version : v0.7.5-NB
55
* Description : Event Header Class in C++, Ansi-style
66
* Author : Egon Zemmer
77
* Company : Phlegx Systems

websocket-rails-client/websocket.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
*
33
* Name : websocket.hpp
4-
* Version : v0.7.4-NB
4+
* Version : v0.7.5-NB
55
* Description : Websocket Header File in C++, Ansi-style
66
* Author : Egon Zemmer
77
* Company : Phlegx Systems

websocket-rails-client/websocket_connection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
*
33
* Name : websocket.cpp
4-
* Version : v0.7.4-NB
4+
* Version : v0.7.5-NB
55
* Description : WebsocketConnection Class in C++, Ansi-style
66
* Author : Egon Zemmer
77
* Company : Phlegx Systems

websocket-rails-client/websocket_connection.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
*
33
* Name : websocket.hpp
4-
* Version : v0.7.4-NB
4+
* Version : v0.7.5-NB
55
* Description : WebsocketConnection Header Class in C++, Ansi-style
66
* Author : Egon Zemmer
77
* Company : Phlegx Systems

websocket-rails-client/websocket_rails.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
*
33
* Name : websocket_rails.cpp
4-
* Version : v0.7.4-NB
4+
* Version : v0.7.5-NB
55
* Description : WebsocketRails Class in C++, Ansi-style
66
* Author : Egon Zemmer
77
* Company : Phlegx Systems
@@ -264,31 +264,31 @@ Channel * WebsocketRails::subscribePrivate(std::string channel_name, cb_func suc
264264

265265

266266
void WebsocketRails::unsubscribe(std::string channel_name) {
267-
Channel * channel;
267+
Channel channel;
268268
{
269269
websocket_rails_lock guard(channel_queue_mutex);
270270
if(this->channel_queue.find(channel_name) == this->channel_queue.end()) {
271271
return;
272272
}
273-
channel = &this->channel_queue[channel_name];
273+
channel = this->channel_queue[channel_name];
274274
this->channel_queue.erase(channel_name);
275275
}
276276
cb_func success_callback, failure_callback;
277-
channel->destroy(success_callback, failure_callback);
277+
channel.destroy(success_callback, failure_callback);
278278
}
279279

280280

281281
void WebsocketRails::unsubscribe(std::string channel_name, cb_func success_callback, cb_func failure_callback) {
282-
Channel * channel;
282+
Channel channel;
283283
{
284284
websocket_rails_lock guard(channel_queue_mutex);
285285
if(this->channel_queue.find(channel_name) == this->channel_queue.end()) {
286286
return;
287287
}
288-
channel = &this->channel_queue[channel_name];
288+
channel = this->channel_queue[channel_name];
289289
this->channel_queue.erase(channel_name);
290290
}
291-
channel->destroy(success_callback, failure_callback);
291+
channel.destroy(success_callback, failure_callback);
292292
}
293293

294294

websocket-rails-client/websocket_rails.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
*
33
* Name : websocket_rails.hpp
4-
* Version : v0.7.4-NB
4+
* Version : v0.7.5-NB
55
* Description : WesocketRails Header Class in C++, Ansi-style
66
* Author : Egon Zemmer
77
* Company : Phlegx Systems

0 commit comments

Comments
 (0)