mirror of https://gitee.com/bigwinds/arangodb
fixed small memleak in application server setup
This commit is contained in:
parent
ce04ec4ae3
commit
4732a42c18
|
@ -82,7 +82,8 @@ static bool UnusedDisableAdminInterface;
|
||||||
ApplicationAdminServer::ApplicationAdminServer ()
|
ApplicationAdminServer::ApplicationAdminServer ()
|
||||||
: ApplicationFeature("admin"),
|
: ApplicationFeature("admin"),
|
||||||
_allowLogViewer(false),
|
_allowLogViewer(false),
|
||||||
_pathOptions(0) {
|
_pathOptions(0),
|
||||||
|
_jobPayload(0) {
|
||||||
_pathOptions = new PathHandler::Options();
|
_pathOptions = new PathHandler::Options();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,6 +92,10 @@ ApplicationAdminServer::ApplicationAdminServer ()
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
ApplicationAdminServer::~ApplicationAdminServer () {
|
ApplicationAdminServer::~ApplicationAdminServer () {
|
||||||
|
if (_jobPayload != 0) {
|
||||||
|
delete _jobPayload;
|
||||||
|
}
|
||||||
|
|
||||||
delete reinterpret_cast<PathHandler::Options*>(_pathOptions);
|
delete reinterpret_cast<PathHandler::Options*>(_pathOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,12 +131,14 @@ void ApplicationAdminServer::addBasicHandlers (HttpHandlerFactory* factory,
|
||||||
Dispatcher* dispatcher,
|
Dispatcher* dispatcher,
|
||||||
AsyncJobManager* jobManager) {
|
AsyncJobManager* jobManager) {
|
||||||
factory->addHandler(prefix + "/version", RestHandlerCreator<RestVersionHandler>::createNoData, 0);
|
factory->addHandler(prefix + "/version", RestHandlerCreator<RestVersionHandler>::createNoData, 0);
|
||||||
|
|
||||||
pair<Dispatcher*, AsyncJobManager*>* data = new pair<Dispatcher*, AsyncJobManager*>(dispatcher, jobManager);
|
if (_jobPayload == 0) {
|
||||||
|
_jobPayload = new pair<Dispatcher*, AsyncJobManager*>(dispatcher, jobManager);
|
||||||
|
}
|
||||||
|
|
||||||
factory->addPrefixHandler(prefix + "/job",
|
factory->addPrefixHandler(prefix + "/job",
|
||||||
RestHandlerCreator<RestJobHandler>::createData< pair<Dispatcher*, AsyncJobManager*>* >,
|
RestHandlerCreator<RestJobHandler>::createData< pair<Dispatcher*, AsyncJobManager*>* >,
|
||||||
data);
|
_jobPayload);
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -192,6 +192,12 @@ namespace triagens {
|
||||||
|
|
||||||
void* _pathOptions;
|
void* _pathOptions;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief data that needs to be freed at shutdown
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
std::pair<rest::Dispatcher*, rest::AsyncJobManager*>* _jobPayload;
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue