Commit 5bfd42fe authored by Marcus Nordenberg's avatar Marcus Nordenberg

xtt: Fix subwindow segfault when updating context

parent 9d5f65b3
......@@ -2754,9 +2754,14 @@ void GlowDrawGtk::pop_customcolors()
{
if (customcolors_cnt <= 0) {
printf("** Customcolor stack disorder\n");
return;
}
for (int i = 0; i < customcolors_cnt - 1; i++)
{
customcolors[i] = customcolors[i + 1];
customcolors[i + 1] = NULL;
}
customcolors_cnt--;
}
......
......@@ -707,12 +707,13 @@ int GrowWindow::update_attributes()
if (window_ctx) {
if (window_ctx->trace_started)
window_ctx->trace_close();
ctx->gdraw->pop_customcolors();
delete window_ctx;
fill_drawtype = original_fill_drawtype = glow_eDrawType_Inherit;
fill = 0;
}
strcpy(file_name, input_file_name);
new_ctx();
new_ctx(true);
sts = 1;
ctx->gdraw->reset_clip_rectangle(ctx->mw.window);
......@@ -843,7 +844,7 @@ void GrowWindow::h_value_changed_cb(void* o, double value)
}
}
void GrowWindow::new_ctx()
void GrowWindow::new_ctx(bool is_updating_attributes)
{
char fname[200];
int sts;
......@@ -899,6 +900,9 @@ void GrowWindow::new_ctx()
strcpy(window_ctx->owner, owner);
window_ctx->customcolors = ctx->gdraw->create_customcolors();
if (is_updating_attributes)
ctx->gdraw->push_customcolors(window_ctx->customcolors);
if (!no_file) {
window_ctx->set_nodraw();
sts = window_ctx->open(fname, glow_eSaveMode_Edit);
......
......@@ -274,7 +274,7 @@ public:
virtual int update_attributes();
//! Create a new grow context
void new_ctx();
void new_ctx(bool is_updating_attributes = false);
// Configure the scrollbars
void configure_scrollbars();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment