void WeakForm<Scalar>::free_ext() { for(unsigned int i = 0; i < this->ext.size(); i++) delete this->ext[i]; for(unsigned int i = 0; i < this->forms.size(); i++) for(unsigned int j = 0; j < get_forms()[i]->ext.size(); j++) delete get_forms()[i]->ext[j]; }
static void test__get_forms( const char *param ) { FILE *filehd; char *html_buf; GSList *forms; int ctr; html_buf = malloc( 75000 ); filehd = fopen( "../../data/oauth2-confirm.html", "r" ); if( ! filehd ) { printf( "Error: cannot find test data\n" ); exit( EXIT_FAILURE ); } if( fread( html_buf, 75000, 1, filehd ) ) { printf( "Error: cannot read test data\n" ); exit( EXIT_FAILURE ); } forms = get_forms( html_buf ); ctr = 1; g_slist_foreach( forms, print_form, &ctr ); }
WeakForm<Scalar>::~WeakForm() { for(unsigned int i = 0; i < this->forms.size(); i++) delete get_forms()[i]; delete_all(); }