diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2008-01-18 10:27:58 -0330 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2008-01-18 10:27:58 -0330 |
commit | 40da4a3aecbc259c472d77f58d1d6466af42e5ef (patch) | |
tree | 3780215d0441c84682c9c281b3187b78973a6b9e /cpp/src/Slice/JavaUtil.cpp | |
parent | Added Windows signal handling (diff) | |
download | ice-40da4a3aecbc259c472d77f58d1d6466af42e5ef.tar.bz2 ice-40da4a3aecbc259c472d77f58d1d6466af42e5ef.tar.xz ice-40da4a3aecbc259c472d77f58d1d6466af42e5ef.zip |
Windows fixes for translator interrupt cleanup
Diffstat (limited to 'cpp/src/Slice/JavaUtil.cpp')
-rw-r--r-- | cpp/src/Slice/JavaUtil.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/cpp/src/Slice/JavaUtil.cpp b/cpp/src/Slice/JavaUtil.cpp index cb4874a2df8..2c8cfde1458 100644 --- a/cpp/src/Slice/JavaUtil.cpp +++ b/cpp/src/Slice/JavaUtil.cpp @@ -27,6 +27,20 @@ using namespace Slice; using namespace IceUtil; using namespace IceUtilInternal; +// +// Callback for Crtl-C signal handling +// +static Slice::JavaGenerator* _javaGen = 0; + +static void closeCallback() +{ + if(_javaGen != 0) + { + _javaGen->close(); + } +} + + Slice::JavaOutput::JavaOutput() { } @@ -160,6 +174,7 @@ Slice::JavaGenerator::JavaGenerator(const string& dir) : _dir(dir), _out(0) { + SignalHandler::setCallback(closeCallback); } Slice::JavaGenerator::JavaGenerator(const string& dir, Slice::FeatureProfile profile) : @@ -183,6 +198,7 @@ Slice::JavaGenerator::open(const string& absolute) if(out->openClass(absolute, _dir)) { _out = out; + _javaGen = this; // For Ctrl-C handling } else { @@ -199,6 +215,7 @@ Slice::JavaGenerator::close() *_out << nl; delete _out; _out = 0; + _javaGen = 0; // For Ctrl-C handling } Output& |