2d4e3cfc29172443a122427f89dbe70709a4e308

Author
outfoxxed <outfoxxed@outfoxxed.me>
Committer
outfoxxed <outfoxxed@outfoxxed.me>
Date

Message

ensure tab text CTexture is created before use

Fixes crash when enabling tab text when it was previously off.

Diff

 1diff --git a/src/TabGroup.cpp b/src/TabGroup.cpp
 2index 1dab1d0c7e1a3feb9e8032fabaaaa3299a6b2552..3071826e753778874c71048c7d3352d7708c1367 100644
 3--- a/src/TabGroup.cpp
 4+++ b/src/TabGroup.cpp
 5@@ -73,8 +73,6 @@ Hy3TabBarEntry::Hy3TabBarEntry(Hy3TabBar& tab_bar, Hy3Node& node): tab_bar(tab_b
 6 
 7 	this->vertical_pos = 0.0;
 8 	this->fade_opacity = 1.0;
 9-
10-	this->texture = makeShared<CTexture>();
11 }
12 
13 bool Hy3TabBarEntry::operator==(const Hy3Node& node) const { return this->node == node; }
14@@ -241,6 +239,8 @@ void Hy3TabBarEntry::renderText(float scale, CBox& box, float opacity) {
15 		g_object_unref(context);
16 
17 		auto data = cairo_image_surface_get_data(cairo_surface);
18+
19+		if (!this->texture) this->texture = makeShared<CTexture>();
20 		this->texture->allocate();
21 
22 		glBindTexture(GL_TEXTURE_2D, this->texture->m_iTexID);