Catch exceptions by reference
We use polymorphic exception objects, so catching by value invokes
the copy constructor and stuff that we don't really want.
diff --git a/tests/encperf.cxx b/tests/encperf.cxx
index 7b9ff81..4e7038f 100644
--- a/tests/encperf.cxx
+++ b/tests/encperf.cxx
@@ -342,7 +342,7 @@
try {
cc = new CConn(fn);
- } catch (rdr::Exception e) {
+ } catch (rdr::Exception& e) {
fprintf(stderr, "Failed to open rfb file: %s\n", e.str());
exit(1);
}
@@ -350,8 +350,8 @@
try {
while (true)
cc->processMsg();
- } catch (rdr::EndOfStream e) {
- } catch (rdr::Exception e) {
+ } catch (rdr::EndOfStream& e) {
+ } catch (rdr::Exception& e) {
fprintf(stderr, "Failed to run rfb file: %s\n", e.str());
exit(1);
}