summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorcah <cah@ableton.com>2020-03-28 00:35:16 +0100
committerCarl Hetherington <cth@carlh.net>2020-03-28 19:47:28 +0100
commit29d9b07e6db976f40d797235d7c233ed8ecf15fa (patch)
tree23a300d3dff21d1759ec8aa4dbc338848be6168e /src/tools
parente2690092620e2f07e4b256dd90959709d549d72a (diff)
Fix _writer process shutdown a little.
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/dcpomatic_dist.cc9
-rw-r--r--src/tools/dcpomatic_dist_writer.cc23
2 files changed, 15 insertions, 17 deletions
diff --git a/src/tools/dcpomatic_dist.cc b/src/tools/dcpomatic_dist.cc
index c94062568..2098eb1a5 100644
--- a/src/tools/dcpomatic_dist.cc
+++ b/src/tools/dcpomatic_dist.cc
@@ -126,8 +126,7 @@ public:
~DOMFrame ()
{
- _writer->terminate ();
- delete _writer;
+ _nanomsg.send("Q\n");
}
private:
@@ -281,12 +280,6 @@ public:
return true;
}
- int OnExit ()
- {
- _frame->Destroy ();
- return 0;
- }
-
void config_failed_to_load ()
{
message_dialog (_frame, _("The existing configuration failed to load. Default values will be used instead. These may take a short time to create."));
diff --git a/src/tools/dcpomatic_dist_writer.cc b/src/tools/dcpomatic_dist_writer.cc
index 04325dd5b..c667f2f95 100644
--- a/src/tools/dcpomatic_dist_writer.cc
+++ b/src/tools/dcpomatic_dist_writer.cc
@@ -365,20 +365,25 @@ idle ()
return true;
}
- dcp_path = *s;
- device = nanomsg->blocking_get();
+ if (*s == "Q") {
+ exit (EXIT_SUCCESS);
+ } else if (*s == "W") {
+ dcp_path = nanomsg->blocking_get();
+ device = nanomsg->blocking_get();
- LOG_DIST ("Here we go writing %1 to %2", dcp_path, device);
+ LOG_DIST ("Here we go writing %1 to %2", dcp_path, device);
#ifdef DCPOMATIC_LINUX
- polkit_authority = polkit_authority_get_sync (0, 0);
- PolkitSubject* subject = polkit_unix_process_new (getppid());
- polkit_authority_check_authorization (
- polkit_authority, subject, "com.dcpomatic.write-drive", 0, POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION, 0, polkit_callback, 0
- );
+ polkit_authority = polkit_authority_get_sync (0, 0);
+ PolkitSubject* subject = polkit_unix_process_new (getppid());
+ polkit_authority_check_authorization (
+ polkit_authority, subject, "com.dcpomatic.write-drive", 0, POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION, 0, polkit_callback, 0
+ );
#else
- write ();
+ write ();
#endif
+ }
+
return true;
}