Commit aac17b1b authored by Peter Hutterer's avatar Peter Hutterer Committed by Chase Douglas
Browse files

xserver: add destructor to tear down the server


Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: default avatarChase Douglas <chase.douglas@canonical.com>
Signed-off-by: default avatarChase Douglas <chase.douglas@canonical.com>
parent 340c07db
......@@ -59,6 +59,7 @@ namespace testing {
class XServer : public xorg::testing::Process {
public:
XServer();
~XServer();
/**
* Start a new server. If no binary is given, the server started is the
......
......@@ -68,6 +68,12 @@ xorg::testing::XServer::XServer() : d_(new Private) {
SetDisplayNumber(d_->display_number);
}
xorg::testing::XServer::~XServer() {
if (Pid() > 0)
if (!Terminate(3000))
Kill(300);
}
void xorg::testing::XServer::SetDisplayNumber(unsigned int display_number) {
d_->display_number = display_number;
......
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