Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

luatrace.tron asserts if it can't find the recorder and troff does no…

…thing if there's no recorder
  • Loading branch information...
commit 143d97762c432aeee2e022dc8d972ee253eb2b1b 1 parent 9468e11
Geoff Leyland geoffleyland authored

Showing 1 changed file with 8 additions and 5 deletions. Show diff stats Hide diff stats

  1. +8 5 lua/luatrace.lua
13 lua/luatrace.lua
@@ -332,6 +332,7 @@ function luatrace.tron(settings)
332 332 else
333 333 recorder = settings.recorder
334 334 end
  335 + assert(recorder, "couldn't find the trace recorder")
335 336 recorder.open(settings)
336 337
337 338 if settings.record_time ~= nil then do_record_time = settings.record_time end
@@ -347,11 +348,13 @@ end
347 348
348 349 -- Turn it off and close the recorder
349 350 function luatrace.troff()
350   - debug.sethook()
351   - recorder.close()
352   - recorder = nil
353   - os.remove(luatrace_exit_trick_file_name)
354   - os.exit = luatrace_raw_exit
  351 + if recorder then
  352 + debug.sethook()
  353 + recorder.close()
  354 + recorder = nil
  355 + os.remove(luatrace_exit_trick_file_name)
  356 + os.exit = luatrace_raw_exit
  357 + end
355 358 end
356 359
357 360

0 comments on commit 143d977

Please sign in to comment.
Something went wrong with that request. Please try again.