Skip to content
Snippets Groups Projects
Commit 095be07e authored by Steven Murray's avatar Steven Murray
Browse files

MediaChangerFacade no longer uses AcsProxyZmqSingleton

parent c4a2e5c9
Branches
Tags
No related merge requests found
......@@ -17,7 +17,6 @@
*/
#include "common/exception/Exception.hpp"
#include "mediachanger/AcsProxyZmqSingleton.hpp"
#include "mediachanger/MediaChangerFacade.hpp"
namespace cta {
......@@ -28,6 +27,7 @@ namespace mediachanger {
//------------------------------------------------------------------------------
MediaChangerFacade::MediaChangerFacade(log::Logger &log, void *const zmqContext) throw():
m_zmqContext(zmqContext),
m_acsProxy(zmqContext),
m_mmcProxy(log) {
}
......@@ -94,12 +94,7 @@ MediaChangerProxy &MediaChangerFacade::getProxy(const TapeLibraryType libraryTyp
try {
switch(libraryType) {
case TAPE_LIBRARY_TYPE_ACS:
// Using AcsProxyZmqSingleton instead of simply having a AcsProxyZmq
// member variable (e.g. m_acsProxy) in order to only instantiate an
// AcsProxyZmq object if necessary. Instantiating such as object
// results in a one off memory leak related to ZMQ that would cause
// valgrind to fail on simple CTA unit-tests.
return AcsProxyZmqSingleton::instance(m_zmqContext);
return m_acsProxy;
case TAPE_LIBRARY_TYPE_MANUAL:
return m_mmcProxy;
case TAPE_LIBRARY_TYPE_SCSI:
......
......@@ -19,6 +19,7 @@
#pragma once
#include "common/log/Logger.hpp"
#include "mediachanger/AcsProxyZmq.hpp"
#include "mediachanger/LibrarySlot.hpp"
#include "mediachanger/MediaChangerProxy.hpp"
#include "mediachanger/MmcProxyLog.hpp"
......@@ -100,6 +101,11 @@ private:
*/
void *m_zmqContext;
/**
* ACS media changer proxy.
*/
AcsProxyZmq m_acsProxy;
/**
* Manual media changer proxy.
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment