zakk4223 / CocoaSplit

Stream/record your desktop/webcam to twitch/owned etc.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CocoaSplit crashes when I write displayed text file

gobzer opened this issue · comments

Hi,
CocoaSplit 2.1.12 crashes when displaying contents of a file being rewritten by an external process.
To reproduce:

  1. make file sample.txt write some text to it.
  2. Open CocoaSplit and add text file source. Source the text from sample.txt
  3. Run this script:

python2

cnt = 0
while True:
    cnt = cnt + 1
    f = open("sample.txt", "w")
    f.write(str(cnt))
    f.close()

CocoaSplit 2.1.12 should crash.

Rewriting text files by an external process is useful either for chat or donations.
I tried to do the same on OBS, but it doesn't crash.

Attached crash report and console messages.
crash_write_to_file.txt
console_write_to_file.txt

Fixed in commit 16564b3

I'll have a new release out in a day or two

Yes. It's not crashing now. But sometimes it skips states.
For example. I count to infinity with a timed interval. On live view the the source sometimes becomes blank. Skips number or two:

import time
cnt = 0
while True:
    time.sleep(1)
    cnt = cnt + 1
    f = open("sample.txt", "w")
    f.write(str(cnt))
    f.close()

(Hopefully) fixed in commit db39e67

File change events were causing double updates of the CATextLayer, one of which was a nil string. Sometimes the layout render would hit during the blank phase. Removed the nil update part and it seems better behaved now