summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-11-13 11:05:39 +0000
committerCarl Hetherington <cth@carlh.net>2014-11-13 11:05:39 +0000
commit59a87a29043d29907c389b9fca7b5865bc0bdf84 (patch)
treed05a3588cc1e0274a4f9b146d277b22a67839db5 /src/lib
parentbf7d89546d4bbc155d4367a7bd5f3e17fa08369a (diff)
Hand-apply 9c251ca3debbf1e529b77ea4d174994ef8b5dd0b from master:
Try to write Windows backtraces to the last-loaded-film's directory.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/film.cc3
-rw-r--r--src/lib/util.cc11
-rw-r--r--src/lib/util.h1
3 files changed, 13 insertions, 2 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc
index 268109921..8144759b6 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -467,6 +467,9 @@ Film::read_metadata ()
/* This method is the only one that can return notes (so far) */
_playlist->set_from_xml (shared_from_this(), f.node_child ("Playlist"), _state_version, notes);
+ /* Write backtraces to this film's directory, until another film is loaded */
+ set_backtrace_file (file ("backtrace.txt"));
+
_dirty = false;
return notes;
}
diff --git a/src/lib/util.cc b/src/lib/util.cc
index 728e7d048..2b7df86bf 100644
--- a/src/lib/util.cc
+++ b/src/lib/util.cc
@@ -282,6 +282,12 @@ LONG WINAPI exception_handler(struct _EXCEPTION_POINTERS *)
}
#endif
+void
+set_backtrace_file (boost::filesystem::path p)
+{
+ backtrace_file = p;
+}
+
/* From http://stackoverflow.com/questions/2443135/how-do-i-find-where-an-exception-was-thrown-in-c */
void
terminate ()
@@ -317,8 +323,9 @@ void
dcpomatic_setup ()
{
#ifdef DCPOMATIC_WINDOWS
- backtrace_file /= g_get_user_config_dir ();
- backtrace_file /= "backtrace.txt";
+ boost::filesystem::path p = g_get_user_config_dir ();
+ p /= "backtrace.txt";
+ set_backtrace_file (p);
SetUnhandledExceptionFilter(exception_handler);
/* Dark voodoo which, I think, gets boost::filesystem::path to
diff --git a/src/lib/util.h b/src/lib/util.h
index 93d0587c5..c06f51ca3 100644
--- a/src/lib/util.h
+++ b/src/lib/util.h
@@ -82,6 +82,7 @@ extern std::string get_optional_string (std::multimap<std::string, std::string>
extern void* wrapped_av_malloc (size_t);
extern int64_t divide_with_round (int64_t a, int64_t b);
extern ContentTimePeriod subtitle_period (AVSubtitle const &);
+extern void set_backtrace_file (boost::filesystem::path);
/** @class Socket
* @brief A class to wrap a boost::asio::ip::tcp::socket with some things