Commit 4bf5c01f authored by neverlord's avatar neverlord

small bugfixes

parent d7088d90
......@@ -90,6 +90,11 @@ class abstract_actor /*[[base_check]]*/ : public Base
// lifetime scope of guard
{
std::lock_guard<std::mutex> guard(m_mtx);
if (m_exit_reason != exit_reason::not_exited)
{
// already exited
return;
}
m_exit_reason = reason;
mlinks = std::move(m_links);
mattachables = std::move(m_attachables);
......
......@@ -107,7 +107,21 @@ class single_reader_queue
return !m_head && !(m_tail.load());
}
single_reader_queue() : m_tail(0), m_head(0) { }
single_reader_queue() : m_tail(nullptr), m_head(nullptr)
{
}
~single_reader_queue()
{
fetch_new_data();
element_type* e = m_head;
while (e)
{
element_type* tmp = e;
e = e->next;
delete tmp;
}
}
private:
......
......@@ -102,16 +102,8 @@ class local_group_module : public group::module
{
upgrade_guard uguard(guard);
auto p = m_instances.insert(std::make_pair(group_name, tmp));
if (p.second == false)
{
// someone preempt us
return p.first->second;
}
else
{
// ok, inserted tmp
return tmp;
}
// someone might preempt us
return p.first->second;
}
}
}
......
......@@ -48,21 +48,21 @@ cppa::process_information compute_proc_info()
char cbuf[100];
// fetch hd serial
std::string hd_serial;
FILE* cmd = popen(s_get_uuid, "r");
while (fgets(cbuf, 100, cmd) != 0)
FILE* get_uuid_cmd = popen(s_get_uuid, "r");
while (fgets(cbuf, 100, get_uuid_cmd) != 0)
{
hd_serial += cbuf;
}
pclose(cmd);
pclose(get_uuid_cmd);
erase_trailing_newline(hd_serial);
// fetch mac address of first network device
std::string first_mac_addr;
cmd = popen(s_get_mac, "r");
while (fgets(cbuf, 100, cmd) != 0)
FILE* get_mac_cmd = popen(s_get_mac, "r");
while (fgets(cbuf, 100, get_mac_cmd) != 0)
{
first_mac_addr += cbuf;
}
pclose(cmd);
pclose(get_mac_cmd);
erase_trailing_newline(first_mac_addr);
result.node_id = cppa::util::ripemd_160(first_mac_addr + hd_serial);
//memcpy(result.node_id, tmp.data(), cppa::process_information::node_id_size);
......
......@@ -611,6 +611,17 @@ class uniform_type_info_map
insert<std::uint64_t>(ints[sizeof(std::uint64_t)].second);
}
~uniform_type_info_map()
{
m_by_rname.clear();
for (auto& kvp : m_by_uname)
{
delete kvp.second;
kvp.second = nullptr;
}
m_by_uname.clear();
}
uniform_type_info* by_raw_name(const std::string& name)
{
auto i = m_by_rname.find(name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment