Skip to content

Access violation in destructor of interpreted_path #69

Open
@mateka

Description

@mateka

Is it ok for the following code to trigger "read access violation" in destructor of interpreted_path?

#include <io2d.h>

using namespace std;
using namespace std::experimental;
using namespace std::experimental::io2d;

int main() {
	auto tileset = image_surface{ filesystem::path{"tileset.png"}, image_file_format::png, format::argb32 };
	brush tilesetBrush{ std::move(tileset) };

	auto display = make_display_surface(640, 480, format::argb32, scaling::letterbox, refresh_rate::fixed, 60.0f);
	brush backBrush{ rgba_color{255.0f, 0.5f, 0.5f} };
	display.letterbox_brush(backBrush);
       
	auto bb = bounding_box{ 0.2f, 0.2f, 0.2f, 0.2f };
	auto cp = clip_props{ bb };
	display.draw_callback([&tilesetBrush, &cp](display_surface& srf) {
		srf.paint(tilesetBrush, nullopt, nullopt, cp);
	});
	return display.begin_show();
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions