Commit Graph

6252 Commits

Author SHA1 Message Date
Paul Licameli
b81cdee7e3 Comment where xml writing functions may throw 2017-03-18 11:45:05 -04:00
Paul Licameli
e3355c3c7e Stops of possible file i/o exceptions in most places needing it...
... excepting uses of XMLFileWriter, still to be done.
2017-03-18 11:20:37 -04:00
Paul Licameli
e9a0876818 TrackPanel aborts any dragging action when an exception escapes 2017-03-17 17:53:03 -04:00
Paul Licameli
006aeda0a9 Use SafelyProcessEvent 2017-03-17 17:53:03 -04:00
Paul Licameli
8e5975b10d Report read exceptions met in SBSMS and Nyquist callbacks to user...
... without letting them propagate through the libraries.
2017-03-17 17:53:03 -04:00
Paul Licameli
a8a2598ba3 Intercept exceptions in command script, report failure. 2017-03-17 17:53:02 -04:00
Paul Licameli
d11027c2a7 Allow exceptions from BlockFile::Recover, handle them in ProjectFSCK 2017-03-17 17:53:02 -04:00
Paul Licameli
f508493561 more guarded calls 2017-03-17 17:53:02 -04:00
Paul Licameli
01c5f25a19 Rewrite one try-catch with GuardedCall so we can show the user errors 2017-03-17 17:53:01 -04:00
Paul Licameli
6525bb18cf Translate exceptions to error codes in callback functions...
... That is what the library protocols allow, and libraries may be written
in C and might corrupt their state if C++ exceptions pass through them.
2017-03-17 17:53:01 -04:00
Paul Licameli
576d3e3013 Don't let the catch-all block in Effect intercept the new exception 2017-03-17 17:53:01 -04:00
Paul Licameli
87e75176c5 Guarded calls in batch processing 2017-03-17 17:53:00 -04:00
Paul Licameli
eeb301e50d Gracefully handle disk exhaustion exceptions during recording 2017-03-17 17:53:00 -04:00
Paul Licameli
f4e2fb5eac AudioIO::StopStream stops exceptions in many non-editing actions 2017-03-17 17:53:00 -04:00
Paul Licameli
a1bc6948f4 Define application-level exception handler of last resort. 2017-03-17 17:53:00 -04:00
Paul Licameli
40e73cdcdd Define classes and functions for exception handling framework 2017-03-17 17:52:59 -04:00
Paul Licameli
9fde75268f Define an AudacityException subclass for unready on-demand data 2017-03-17 17:52:58 -04:00
Paul Licameli
acf3c018bb Define an AudacityException subclass for user cancellation of progress 2017-03-17 17:52:58 -04:00
Paul Licameli
195509a033 Define an AudacityException subclass for file errors 2017-03-17 17:52:58 -04:00
Paul Licameli
f1cce8aa78 Define an AudacityException subclass for assertion violations 2017-03-17 17:52:57 -04:00
Paul Licameli
df077d171a Exception framework: define AudacityException and GuardedCall...
AudacityException is an abstract base class for exceptions generated by
Audacity.

GuardedCall wraps any function (usually a lambda) in an appropriate catch
block.

It can also accept a second function that defines a catch block action, which
can rethrow or return a value for the GuardedCall.

It can also accept a third function, that defines another, delayed action that
executes in the main thread at idle time if the second function intercepts an
AudacityException and completes without rethrow.

Defaults for the second function simply return void or false.  Default for the
third function invokes a virtual method of AudacityException, which for
subclass MessageBoxException, displays a message box.
2017-03-17 17:52:57 -04:00
Paul Licameli
26f917b1fd On-demand tasks check for i/o errors, and if so, make no false progress 2017-03-17 17:52:56 -04:00
Paul Licameli
1c91c2b804 ODDecodeTask makes progress unless there is an exception 2017-03-17 17:52:56 -04:00
Paul Licameli
1a3212611b ODComputeSummaryTask is safe for exceptions; makes no progress then 2017-03-17 17:52:55 -04:00
Paul Licameli
5de19dc952 ODDecode task checks blockfile error, making no progress if so...
... also replace explicit mutex locking with RAII and atomics.

This is a part of the big project that handles failure to write block files, as
from disk exhaustion.  ODDecodeBlockFile::WriteODDecodeBlockFile is the one
place calling WriteSimpleBlockFile but not (as in SimpleBlockFile constructor)
throwing an exception.

It is called only when attempting to recover files at open time, or in worker
threads in an EXPERIMENTAL code branch.
2017-03-17 17:52:55 -04:00
Paul Licameli
a399d4e23a No naked malloc (calloc, strup, ...) and free! 2017-03-17 17:52:54 -04:00
Paul Licameli
1126925438 Remove naked malloc (or similar) and free in: various 2017-03-17 17:52:54 -04:00
Paul Licameli
cab99f7234 Remove naked malloc (or similar) and free in: other effects 2017-03-17 17:52:53 -04:00
Paul Licameli
0c7e467a08 Remove naked malloc (or similar) and free in: reverb 2017-03-17 17:52:53 -04:00
Paul Licameli
03809532ca Remove naked malloc (or similar) and free in: Equalization48x 2017-03-17 17:52:53 -04:00
Paul Licameli
1614db9994 Remove naked malloc (or similar) and free in: export 2017-03-17 17:52:52 -04:00
Paul Licameli
9314fe0cc0 Remove naked malloc (or similar) and free in: import 2017-03-17 17:52:52 -04:00
Paul Licameli
48d951d9c3 Remove naked malloc (or similar) and free in: RawAudioGuess.cpp 2017-03-17 17:52:52 -04:00
Paul Licameli
53b9869268 Remove naked malloc (or similar) and free in: FFmpeg 2017-03-17 17:52:51 -04:00
Paul Licameli
58574f2f78 Redo type HFFT as a smart pointer, remove malloc and free 2017-03-17 17:52:51 -04:00
Paul Licameli
c5007d846e No naked array new! 2017-03-17 17:52:50 -04:00
Paul Licameli
6ca89c28ff Remove naked new[] in: builtin effects 2017-03-17 17:52:49 -04:00
Paul Licameli
f858d97352 Remove naked new[] in: linear algebra functions for Repair 2017-03-17 17:52:49 -04:00
Paul Licameli
cb05476c45 Remove naked new[] in: effects plug-ins 2017-03-17 17:52:48 -04:00
Paul Licameli
a4c7d37d3e Remove naked new[] in: effects framework 2017-03-17 17:52:48 -04:00
Paul Licameli
692a033968 Remove naked new[] in: various 2017-03-17 17:52:47 -04:00
Paul Licameli
ce2e154e89 Remove naked new[] in: Benchmark 2017-03-17 17:52:47 -04:00
Paul Licameli
18be1bdad6 Remove naked new[] in: tracks 2017-03-17 17:52:47 -04:00
Paul Licameli
2b23667211 Remove naked new[] in: AudioIO 2017-03-17 17:52:46 -04:00
Paul Licameli
e6db1a57a3 Remove naked new[] in: blockfile and commands 2017-03-17 17:52:46 -04:00
Paul Licameli
88cac8cd7e Remove naked new[] in: import 2017-03-17 17:52:46 -04:00
Paul Licameli
9bdc7b2cbf Remove naked new[] in: export 2017-03-17 17:52:45 -04:00
Paul Licameli
ea05fac870 Remove naked new[] in: mixer 2017-03-17 17:52:45 -04:00
Paul Licameli
0113e6f44f Remove naked new[] in: ondemand, toolbars, widgets 2017-03-17 17:52:45 -04:00
Paul Licameli
089e696cab More utilities in MemoryX.h 2017-03-17 17:52:44 -04:00