Add front-end name to InitMessage from WriterFrontend to Backend.

At the time WriterBackend::Init() happens, it's in a different thread
than its frontend member, but tried to access it directly to get its
name, that info is now sent in the InitMessage instead.

(Problem was observed segfaulting the unit test
scripts.base.frameworks.notice.mail-alarms on Ubuntu 12.04).
This commit is contained in:
Jon Siwek 2012-06-28 15:48:03 -05:00
parent 1bbd63970a
commit 41f1544332
3 changed files with 11 additions and 7 deletions

View file

@ -108,13 +108,13 @@ void WriterBackend::DisableFrontend()
SendOut(new DisableMessage(frontend));
}
bool WriterBackend::Init(string arg_path, int arg_num_fields, const Field* const* arg_fields)
bool WriterBackend::Init(string arg_path, int arg_num_fields, const Field* const* arg_fields, string frontend_name)
{
path = arg_path;
num_fields = arg_num_fields;
fields = arg_fields;
string name = Fmt("%s/%s", path.c_str(), frontend->Name().c_str());
string name = Fmt("%s/%s", path.c_str(), frontend_name.c_str());
SetName(name);