Fix segfault when refreshing render window

When not rendering, hitting F5 would produce a segmentation fault.
Merge pull request #4 from CounterPillow/refresh-segfault-fix

Fix segfault when refreshing render window