Skip to content

Commit

Permalink
correcao reset array durante cancel terceiro
Browse files Browse the repository at this point in the history
  • Loading branch information
stdmedoth committed Jun 21, 2021
1 parent a56f6c8 commit 83cf1fc
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
Binary file removed Pedidos.o
Binary file not shown.
Binary file removed pedidos
Binary file not shown.
2 changes: 0 additions & 2 deletions src/Terceiros/campos/contatos.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ static void add_item (GtkWidget *button, gpointer data)
GtkTreeViewColumn *column;
GtkTreeView *treeview = (GtkTreeView *)data;

g_return_if_fail (cont_lis != NULL);

contato.ativo = 1;
contato.nome = g_strdup ("-");
contato.telefone = g_strdup ("-");
Expand Down
10 changes: 10 additions & 0 deletions src/Terceiros/cancela.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@ void cancelar_ter(){
gtk_widget_set_sensitive(GTK_WIDGET(alterar_ter_buttom),TRUE);
gtk_notebook_set_current_page(GTK_NOTEBOOK(ter_notebook),0);

/* create array */
if(cont_lis){
g_array_free(cont_lis, FALSE);
}
cont_lis = g_array_sized_new (FALSE, FALSE, sizeof (Contato), 1);
if(cont_rem_lis){
g_array_free(cont_rem_lis, FALSE);
}
cont_rem_lis = g_array_sized_new (FALSE, FALSE, sizeof (Contato), 1);

GtkListStore *contatos_model =(GtkListStore *) gtk_tree_view_get_model(GTK_TREE_VIEW( contatos_treeview ));
if(contatos_model){
g_object_ref(G_OBJECT(contatos_model));
Expand Down

0 comments on commit 83cf1fc

Please sign in to comment.