Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2014-07-11 03:48:59 -0400
committerUwe Stieber2014-07-11 03:48:59 -0400
commit7c42bffdefd8f124f123aa5fec5ccd8d94544473 (patch)
treea4430bd4bb63f14db81c894d1b6974e2cac9ab01
parent85331bd92c302e13839b5a7c7c8973444cc5a231 (diff)
downloadorg.eclipse.tcf-7c42bffdefd8f124f123aa5fec5ccd8d94544473.tar.gz
org.eclipse.tcf-7c42bffdefd8f124f123aa5fec5ccd8d94544473.tar.xz
org.eclipse.tcf-7c42bffdefd8f124f123aa5fec5ccd8d94544473.zip
Target Explorer: Fix stepper based channel manager reference count handling
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/channelmanager/ChannelManager2.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/channelmanager/ChannelManager2.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/channelmanager/ChannelManager2.java
index 57f8f2dfd..698817904 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/channelmanager/ChannelManager2.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/channelmanager/ChannelManager2.java
@@ -129,7 +129,7 @@ public class ChannelManager2 extends PlatformObject implements IChannelManager {
// If the channel is still open, it's all done and the channel can be returned right away
if (channel.getState() == IChannel.STATE_OPEN) {
// Increase the reference count
- AtomicInteger counter = refCounters.get(id);
+ AtomicInteger counter = refCounters.get(channel);
if (counter == null) {
counter = new AtomicInteger(0);
refCounters.put(channel, counter);
@@ -317,7 +317,7 @@ public class ChannelManager2 extends PlatformObject implements IChannelManager {
// Channel is not in open state -> drop the instance
channel = null;
channels.remove(id);
- refCounters.remove(id);
+ refCounters.remove(channel);
}
return channel;
@@ -366,7 +366,7 @@ public class ChannelManager2 extends PlatformObject implements IChannelManager {
final boolean isRefCounted = !forcedChannels.contains(channel);
// Get the reference counter (if the channel is a reference counted channel)
- AtomicInteger counter = isRefCounted ? refCounters.get(id) : null;
+ AtomicInteger counter = isRefCounted ? refCounters.get(channel) : null;
// If the counter is null or get 0 after the decrement, close the channel
if (counter == null || counter.decrementAndGet() == 0) {
@@ -403,8 +403,8 @@ public class ChannelManager2 extends PlatformObject implements IChannelManager {
pendingCloseChannel.remove(id);
// Clean the reference counter and the channel map
- if (isRefCounted) refCounters.remove(id);
- if (isRefCounted) channels.remove(channel);
+ if (isRefCounted) channels.remove(id);
+ if (isRefCounted) refCounters.remove(channel);
if (!isRefCounted) forcedChannels.remove(channel);
if (CoreBundleActivator.getTraceHandler().isSlotEnabled(0, ITraceIds.TRACE_CHANNEL_MANAGER)) {
@@ -497,7 +497,7 @@ public class ChannelManager2 extends PlatformObject implements IChannelManager {
IChannel channel = internalGetChannel(peer);
if (channel != null) {
// Reset the reference count (will force a channel close)
- refCounters.remove(id);
+ refCounters.remove(channel);
// Close the channel
internalCloseChannel(channel);

Back to the top