diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2018-12-14 16:58:23 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2018-12-14 16:58:23 (GMT) |
commit | 3e59fd7f2b55b60efd3c8deadffd15c8b7d68e53 (patch) | |
tree | ab0f22057f69c0beed0cb45c9ca830428410199d /tksao/frame | |
parent | b00839e33a242f825659b0c970f1c4a06eb9f3b6 (diff) | |
download | blt-3e59fd7f2b55b60efd3c8deadffd15c8b7d68e53.zip blt-3e59fd7f2b55b60efd3c8deadffd15c8b7d68e53.tar.gz blt-3e59fd7f2b55b60efd3c8deadffd15c8b7d68e53.tar.bz2 |
fix possible NULL ptr issue
Diffstat (limited to 'tksao/frame')
-rw-r--r-- | tksao/frame/grid25d.C | 8 | ||||
-rw-r--r-- | tksao/frame/grid2d.C | 7 | ||||
-rw-r--r-- | tksao/frame/grid3d.C | 7 |
3 files changed, 20 insertions, 2 deletions
diff --git a/tksao/frame/grid25d.C b/tksao/frame/grid25d.C index e863490..53712fa 100644 --- a/tksao/frame/grid25d.C +++ b/tksao/frame/grid25d.C @@ -22,6 +22,7 @@ Grid25d::~Grid25d() int Grid25d::doit(RenderMode rm) { Frame3dBase* pp = (Frame3dBase*)parent_; + astGrid25dPtr =NULL; matrix_ = pp->widgetToCanvas; pixmap_ = pp->pixmap; @@ -54,6 +55,12 @@ int Grid25d::doit(RenderMode rm) break; default: { + // ast_ maybe NULL + if (!fits->ast_) { + astEnd; // now, clean up memory + return 1; + } + // set desired skyformat if (!fits->wcsInv()) { astEnd; // now, clean up memory @@ -70,7 +77,6 @@ int Grid25d::doit(RenderMode rm) case 1: // error astEnd; // now, clean up memory - astGrid25dPtr =NULL; return 0; case 2: break; diff --git a/tksao/frame/grid2d.C b/tksao/frame/grid2d.C index 923a2d1..499e4d0 100644 --- a/tksao/frame/grid2d.C +++ b/tksao/frame/grid2d.C @@ -22,6 +22,7 @@ Grid2d::~Grid2d() int Grid2d::doit(RenderMode rm) { FrameBase* pp = (FrameBase*)parent_; + astGrid2dPtr =NULL; matrix_ = pp->widgetToCanvas; pixmap_ = pp->pixmap; @@ -54,6 +55,11 @@ int Grid2d::doit(RenderMode rm) break; default: { + // ast_ maybe NULL + if (!fits->ast_) { + astEnd; // now, clean up memory + return 1; + } // set desired skyformat if (!fits->wcsInv()) { @@ -71,7 +77,6 @@ int Grid2d::doit(RenderMode rm) case 1: // error astEnd; // now, clean up memory - astGrid2dPtr =NULL; return 0; case 2: break; diff --git a/tksao/frame/grid3d.C b/tksao/frame/grid3d.C index 31440cf..91cfb69 100644 --- a/tksao/frame/grid3d.C +++ b/tksao/frame/grid3d.C @@ -22,6 +22,7 @@ Grid3d::~Grid3d() int Grid3d::doit(RenderMode rm) { Frame3dBase* pp = (Frame3dBase*)parent_; + astGrid3dPtr =NULL; mx_ = pp->refToWidget3d; rx_ = @@ -56,6 +57,12 @@ int Grid3d::doit(RenderMode rm) break; default: { + // ast_ maybe NULL + if (!fits->ast_) { + astEnd; // now, clean up memory + return 1; + } + if (!fits->wcsInv()) { astEnd; // now, clean up memory return 1; |