Made child processes exit automatically

This commit is contained in:
jsrobson10 2019-04-19 11:31:20 +10:00
parent 56f653765c
commit 45d7fd78d2
5 changed files with 32 additions and 2 deletions

View File

@ -45,3 +45,10 @@ process.on('message', function(data)
proxy.write(Buffer(data));
}
});
// Has the parent been killed
process.on('disconnect', function()
{
// Exit
process.exit();
});

7
rsa.js
View File

@ -109,3 +109,10 @@ process.on('message', function(message)
process.exit();
}*/
});
// Has the parent been killed
process.on('disconnect', function()
{
// Exit
process.exit();
});

View File

@ -499,6 +499,19 @@ function connect(profile, connection_id)
g.users = data.users;
g.chats = data.chats;
// Remove the disabled class
$("#profile_button_"+connection_id).removeClass("disabled");
// Set onclick
$("#profile_button_"+connection_id).on("click", function()
{
// Switch to the profile id
profile_switch_to(connection_id);
});
// Set the href
document.getElementById("profile_button_"+connection_id).href = "#";
// Switch to this chat
profile_switch_to(connection_id);
}

View File

@ -361,8 +361,7 @@ function profiles_reload()
var profile = document.createElement("li");
// Set the html for the list item
profile.innerHTML = "<a href='#' onclick='profile_switch_to("+
i+")'>"+title(i)+"</a>";
profile.innerHTML = "<a class='disabled' id='profile_button_"+i+"'>"+title(i)+"</a>";
// Add the profile to the menu
chat_menu.appendChild(profile);

View File

@ -113,3 +113,7 @@
position: fixed;
visibility: hidden;
}
#server-menu-profiles li a.disabled {
background-color: #BBC;
}