-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(broker/lua): Memory leak due to garbage collector fixed
REFS: MON-34712
- Loading branch information
1 parent
11570c5
commit ed6745a
Showing
30 changed files
with
1,908 additions
and
357 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
/* | ||
** Copyright 2009-2013,2015-2017,2019-2021 Centreon | ||
** | ||
** Licensed under the Apache License, Version 2.0 (the "License"); | ||
** you may not use this file except in compliance with the License. | ||
** You may obtain a copy of the License at | ||
** | ||
** http://www.apache.org/licenses/LICENSE-2.0 | ||
** | ||
** Unless required by applicable law or agreed to in writing, software | ||
** distributed under the License is distributed on an "AS IS" BASIS, | ||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
** See the License for the specific language governing permissions and | ||
** limitations under the License. | ||
** | ||
** For more information : [email protected] | ||
*/ | ||
/** | ||
* Copyright 2009-2013,2015-2017,2019-2021 Centreon | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* For more information : [email protected] | ||
*/ | ||
|
||
#include "com/centreon/broker/multiplexing/muxer.hh" | ||
|
||
|
@@ -195,15 +195,19 @@ std::shared_ptr<muxer> muxer::create(std::string name, | |
* Destructor. | ||
*/ | ||
muxer::~muxer() noexcept { | ||
stats::center::instance().unregister_muxer(_name); | ||
unsubscribe(); | ||
std::lock_guard<std::mutex> lock(_mutex); | ||
SPDLOG_LOGGER_INFO(log_v2::core(), | ||
"Destroying muxer {}: number of events in the queue: {}", | ||
_name, _events_size); | ||
_clean(); | ||
{ | ||
std::lock_guard<std::mutex> lock(_mutex); | ||
SPDLOG_LOGGER_INFO(log_v2::core(), | ||
"Destroying muxer {}: number of events in the queue: {}", | ||
_name, _events_size); | ||
_clean(); | ||
} | ||
DEBUG( | ||
fmt::format("DESTRUCTOR muxer {:p} {}", static_cast<void*>(this), _name)); | ||
// caution, unregister_muxer must be the last center method called at muxer | ||
// destruction to avoid re create a muxer stat entry | ||
stats::center::instance().unregister_muxer(_name); | ||
} | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
/* | ||
** Copyright 2018 Centreon | ||
** | ||
** Licensed under the Apache License, Version 2.0 (the "License"); | ||
** you may not use this file except in compliance with the License. | ||
** You may obtain a copy of the License at | ||
** | ||
** http://www.apache.org/licenses/LICENSE-2.0 | ||
** | ||
** Unless required by applicable law or agreed to in writing, software | ||
** distributed under the License is distributed on an "AS IS" BASIS, | ||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
** See the License for the specific language governing permissions and | ||
** limitations under the License. | ||
** | ||
** For more information : [email protected] | ||
*/ | ||
/** | ||
* Copyright 2018-2024 Centreon | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* For more information : [email protected] | ||
*/ | ||
|
||
#ifndef CCB_LUA_LUABINDING_HH | ||
#define CCB_LUA_LUABINDING_HH | ||
|
@@ -112,7 +112,7 @@ class luabinding { | |
macro_cache& cache); | ||
luabinding(luabinding const&) = delete; | ||
luabinding& operator=(luabinding const&) = delete; | ||
~luabinding() noexcept = default; | ||
~luabinding() noexcept; | ||
bool has_filter() const noexcept; | ||
int32_t write(std::shared_ptr<io::data> const& data) noexcept; | ||
bool has_flush() const noexcept; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
ed6745a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Robot Results
Failed Tests
External-Commands2