-
Notifications
You must be signed in to change notification settings - Fork 57
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
CairoScript should probably not use finalizers #215
Comments
a) Could you please specify 'your Mac' further? libcairo documentation mentions anyway https://www.cairographics.org/manual/bindings-streams.html to use the stream implementation and do a language specific adaptation for files. |
I've updated the comment to include the macOS version. The issue is that this might randomly work if the gc runs before the file is read. It is completely unpredictable but might happen on Travis but not locally or the opposite. Locally, I was watching the file and exactly I executed |
#200 is what I hit here. |
I looked around a little bit and i agree with you, Script Surfaces should be explicitly destroyed. |
@andreasnoack Sorry for the confusion, but you confirmed, that you saw this problem like in #200, the test for file existence is true, the check for length and content is failing? And you can confirm, that only the gc call writes the file, but not the destroy call? |
Yes
Yes
No and I'm not sure what you had in mind. The way I confirmed this was to |
With #251 CairoScript Surface feature is reduced to stream only, which is recommended by libcairo documentation anyway and seems to test fine. |
At least on macOS 10.13.3, it seems that CairoScript only writes to the files in this test when the finalizer is called. This might also what has caused the issues on Windows. My guess is that CairoScript shouldn't rely on finalizers but that the handle should be explicitly
destroy
ed every time.The text was updated successfully, but these errors were encountered: