Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash caused when a context operation is performed inside a fs.readFile() after creating a canvas element. #8239

Open
prominentdetail opened this issue Dec 11, 2024 · 0 comments

Comments

@prominentdetail
Copy link

prominentdetail commented Dec 11, 2024

Issue Type

bug report, crashing.

Crash caused when a context operation is performed inside a fs.readFile() after creating a canvas element.
It works fine prior to 0.90.0

Additional Info

var gui = require('nw.gui');	
gui.Window.get().showDevTools();


var fs = require("fs");
var fileName = 'config.ini';

var canvas;
var context;
var canvasOverlay;
var contextOverlay;

fs.readFile(fileName, "utf8", function(error, data) {
	if(!error){
		var result = data.split( "\r\n" );
		
		config.loadSettings( result );
	}
	
	
//uncomment the setTimeout to make it not crash
//	setTimeout(function(){ 
	
		canvas = document.createElement('canvas');
		context = canvas.getContext('2d');
		canvasOverlay = document.createElement('canvas');
		contextOverlay = canvasOverlay.getContext('2d');
		
		contextOverlay.clearRect(0,0,1,1);

//	 0);


});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant