Skip to content

Commit

Permalink
destroy saved path after use
Browse files Browse the repository at this point in the history
  • Loading branch information
calvinsomething committed Jul 26, 2022
1 parent dffb7f5 commit 5d30074
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/CanvasRenderingContext2d.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#include "Util.h"
#include <vector>

#include <iostream>

using namespace v8;

Nan::Persistent<FunctionTemplate> Context2d::constructor;
Expand Down Expand Up @@ -409,6 +411,8 @@ Context2d::fill(bool preserve) {
cairo_rectangle(_context, 0, 0, width, height);
cairo_clip(_context);
cairo_append_path(_context, savedPath);
cairo_path_destroy(savedPath);
std::cout << "destorying path" << std::endl;
cairo_pattern_set_extend(cairo_get_source(_context), CAIRO_EXTEND_REPEAT);
needsRestore = true;
}
Expand Down

0 comments on commit 5d30074

Please sign in to comment.