<div dir="ltr">Oops, that's my fault. This file should not have been even created normally. It's only used in profiling. It's still there because of some global initialization. I'll make sure the code is not used where unnecessary and post a patch soon. Sorry for having this problem.</div><div class="gmail_extra"><br><div class="gmail_quote">2017-03-11 2:20 GMT+03:00 Eric Anholt <span dir="ltr"><<a href="mailto:eric@anholt.net" target="_blank">eric@anholt.net</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">If apitrace was to crash or get killed, the destructor wouldn't get<br>
called and the temp would get left on disk.  Nothing else re-opens the<br>
file, so just unlink it immediately.<br>
---<br>
 retrace/mmap_allocator.hpp | 4 +---<br>
 1 file changed, 1 insertion(+), 3 deletions(-)<br>
<br>
diff --git a/retrace/mmap_allocator.hpp b/retrace/mmap_allocator.hpp<br>
index adc08bbe2c1a..e6318aba9dc0 100644<br>
--- a/retrace/mmap_allocator.hpp<br>
+++ b/retrace/mmap_allocator.hpp<br>
@@ -56,7 +56,6 @@ private:<br>
     const size_t chunkSize;<br>
     std::list<void*> mmaps;<br>
     void* vptr;<br>
-    std::string fileName;<br>
<br>
     MmapedFileBuffer(<wbr>MmapedFileBuffer const&) = delete;<br>
<br>
@@ -80,7 +79,7 @@ public:<br>
     {<br>
         char templ[] = ".pbtmpXXXXXX";<br>
         fd = mkstemp(templ);<br>
-        fileName = templ;<br>
+        unlink(templ);<br>
         newMmap();<br>
     }<br>
<br>
@@ -89,7 +88,6 @@ public:<br>
         for (auto &m : mmaps) {<br>
             munmap(m, chunkSize);<br>
         }<br>
-        unlink(fileName.c_str());<br>
     }<br>
<br>
     void* allocate(size_t size) {<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.11.0<br>
<br>
______________________________<wbr>_________________<br>
apitrace mailing list<br>
<a href="mailto:apitrace@lists.freedesktop.org">apitrace@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/apitrace" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/apitrace</a><br>
</font></span></blockquote></div><br></div>