Skip to content

Commit

Permalink
Merge pull request #936 from jmmorato/master
Browse files Browse the repository at this point in the history
 Wrong entity_refs_ counter when deleting data reader in the TopicDescriptionImpl

(cherry picked from commit eb9e483)
  • Loading branch information
mitza-oci committed Apr 1, 2019
1 parent 0dd6c11 commit adff1aa
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 10 deletions.
32 changes: 24 additions & 8 deletions dds/DCPS/DataReaderImpl.cpp
Expand Up @@ -126,14 +126,6 @@ DataReaderImpl::DataReaderImpl()
DataReaderImpl::~DataReaderImpl()
{
DBG_ENTRY_LVL("DataReaderImpl","~DataReaderImpl",6);

#ifndef OPENDDS_NO_OWNERSHIP_KIND_EXCLUSIVE
OwnershipManagerPtr owner_manager = this->ownership_manager();
if (owner_manager) {
owner_manager->unregister_reader(topic_servant_->type_name(), this);
}
#endif

}

// this method is called when delete_datareader is called.
Expand All @@ -145,6 +137,22 @@ DataReaderImpl::cleanup()
// deleted
set_listener(0, NO_STATUS_MASK);

#ifndef OPENDDS_NO_OWNERSHIP_KIND_EXCLUSIVE
OwnershipManagerPtr owner_manager = this->ownership_manager();
if (owner_manager) {
owner_manager->unregister_reader(topic_servant_->type_name(), this);
}
#endif

topic_servant_ = 0;

#ifndef OPENDDS_NO_CONTENT_FILTERED_TOPIC
content_filtered_topic_ = 0;
#endif

#ifndef OPENDDS_NO_MULTI_TOPIC
multi_topic_ = 0;
#endif

}

Expand Down Expand Up @@ -3143,6 +3151,14 @@ DataReaderImpl::get_cf_topic() const
}
#endif

#ifndef OPENDDS_NO_MULTI_TOPIC
void
DataReaderImpl::enable_multi_topic(MultiTopicImpl* mt)
{
multi_topic_ = mt;
}
#endif

#ifndef OPENDDS_NO_CONTENT_SUBSCRIPTION_PROFILE

void
Expand Down
14 changes: 12 additions & 2 deletions dds/DCPS/DataReaderImpl.h
Expand Up @@ -27,6 +27,7 @@
#include "Stats_T.h"
#include "OwnershipManager.h"
#include "ContentFilteredTopicImpl.h"
#include "MultiTopicImpl.h"
#include "GroupRakeData.h"
#include "CoherentChangeControl.h"
#include "AssociationData.h"
Expand Down Expand Up @@ -473,6 +474,12 @@ class OpenDDS_Dcps_Export DataReaderImpl

DDS::ContentFilteredTopic_ptr get_cf_topic() const;

#endif

#ifndef OPENDDS_NO_MULTI_TOPIC

void enable_multi_topic(MultiTopicImpl* mt);

#endif

void update_subscription_params(const DDS::StringSeq& params) const;
Expand Down Expand Up @@ -641,6 +648,9 @@ class OpenDDS_Dcps_Export DataReaderImpl
TopicDescriptionPtr<ContentFilteredTopicImpl> content_filtered_topic_;
#endif

#ifndef OPENDDS_NO_MULTI_TOPIC
TopicDescriptionPtr<MultiTopicImpl> multi_topic_;
#endif

/// Is accessing to Group coherent changes ?
bool coherent_;
Expand Down Expand Up @@ -755,8 +765,8 @@ class OpenDDS_Dcps_Export DataReaderImpl

void check_liveliness()
{
CheckLivelinessCommand c(this);
execute_or_enqueue(c);
CheckLivelinessCommand c(this);
execute_or_enqueue(c);
}

void cancel_timer()
Expand Down
1 change: 1 addition & 0 deletions dds/DCPS/MultiTopicDataReaderBase.cpp
Expand Up @@ -108,6 +108,7 @@ void MultiTopicDataReaderBase::init(const DDS::DataReaderQos& dr_qos,
return;
}

resulting_impl->enable_multi_topic(multitopic);
resulting_impl->raw_latency_buffer_size() = parent->raw_latency_buffer_size();
resulting_impl->raw_latency_buffer_type() = parent->raw_latency_buffer_type();

Expand Down

0 comments on commit adff1aa

Please sign in to comment.