]> git.tdb.fi Git - libs/gl.git/commitdiff
Check for non-null buffer in Bufferable's refresh function
authorMikko Rasa <tdb@tdb.fi>
Sun, 9 Feb 2020 22:04:14 +0000 (00:04 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sun, 9 Feb 2020 22:04:14 +0000 (00:04 +0200)
source/bufferable.h

index 66a6db1871952a2a7e7940bd5f9f931cd88eb808..f47ef4cabf17c1664838195778910886fcda778b 100644 (file)
@@ -46,7 +46,7 @@ public:
        void use_buffer(Buffer *buf, Bufferable *prev = 0);
 
        /** Uploads new data into the buffer if necessary. */
-       void refresh() const { if(dirty) update_buffer(); }
+       void refresh() const { if(buffer && dirty) update_buffer(); }
 
        AsyncUpdater *refresh_async() const;