Browse Source

Merge pull request #135 from Tharit/master

fixed memory leaks in context2d
v1.x
TJ Holowaychuk 13 years ago
parent
commit
9821f2cf7b
  1. 4
      src/CanvasRenderingContext2d.cc

4
src/CanvasRenderingContext2d.cc

@ -139,6 +139,9 @@ Context2d::Context2d(Canvas *canvas) {
*/ */
Context2d::~Context2d() { Context2d::~Context2d() {
while(stateno>=0) {
free(states[stateno--]);
}
cairo_destroy(_context); cairo_destroy(_context);
} }
@ -205,6 +208,7 @@ void
Context2d::restorePath() { Context2d::restorePath() {
cairo_new_path(_context); cairo_new_path(_context);
cairo_append_path(_context, _path); cairo_append_path(_context, _path);
cairo_path_destroy(_path);
} }
/* /*

Loading…
Cancel
Save