mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
debug-viewer: Fix reload file action.
Copy the log file only we're loading a file different from the previous file. The previous version of this code was broken because the existing tmpfile was removed from disk before being copied to a new temporary file.
This commit is contained in:
parent
1a9455d2f6
commit
7e2200d889
1 changed files with 5 additions and 4 deletions
|
@ -941,18 +941,19 @@ class Window (object):
|
||||||
if self.log_file is not None:
|
if self.log_file is not None:
|
||||||
for feature in self.features:
|
for feature in self.features:
|
||||||
feature.handle_detach_log_file(self, self.log_file)
|
feature.handle_detach_log_file(self, self.log_file)
|
||||||
self.tmpfile = None
|
|
||||||
|
|
||||||
if filename is None:
|
if filename is None:
|
||||||
if self.dispatcher is not None:
|
if self.dispatcher is not None:
|
||||||
self.dispatcher.cancel()
|
self.dispatcher.cancel()
|
||||||
self.dispatcher = None
|
self.dispatcher = None
|
||||||
self.log_file = None
|
self.log_file = None
|
||||||
|
self.tmpfile = None
|
||||||
self.actions.groups["RowActions"].props.sensitive = False
|
self.actions.groups["RowActions"].props.sensitive = False
|
||||||
else:
|
else:
|
||||||
self.tmpfile = tempfile.NamedTemporaryFile()
|
if self.tmpfile and filename != self.tmpfile.name:
|
||||||
shutil.copyfile(filename, self.tmpfile.name)
|
self.tmpfile = tempfile.NamedTemporaryFile()
|
||||||
filename = self.tmpfile.name
|
shutil.copyfile(filename, self.tmpfile.name)
|
||||||
|
filename = self.tmpfile.name
|
||||||
self.logger.debug("setting log file %r", filename)
|
self.logger.debug("setting log file %r", filename)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue