Clang-tidy, fix bugprone-exception-escape.

Remove redundant call to `ofstream::close()` from `~PSStrokeRenderer`
and `~TextStrokeRenderer`. ofstream will be destructed automatically.

- For `~Depsgraph`, `std::function`'s constructor can throw.
- Passing throwing statements in the lambda will not be detected by
  clang-tidy.
Fix these issues by using lambda as function argument.

Reviewed By: sergey, sybren
Differential Revision: https://developer.blender.org/D9497
This commit is contained in:
Ankit Meel
2020-11-17 17:10:03 +05:30
committed by Ankit Meel
parent 417224a31b
commit 88de58fd1a
7 changed files with 5 additions and 38 deletions

View File

@@ -53,15 +53,11 @@ namespace Freestyle {
class TextStrokeRenderer : public StrokeRenderer {
public:
TextStrokeRenderer(const char *iFileName = NULL);
virtual ~TextStrokeRenderer();
/*! Renders a stroke rep */
virtual void RenderStrokeRep(StrokeRep *iStrokeRep) const;
virtual void RenderStrokeRepBasic(StrokeRep *iStrokeRep) const;
/*! Closes the output file */
void Close();
protected:
mutable ofstream _ofstream;
};