int handwritor::destroy (void) {
	if (destroyed) {
		return -1;
	}

	if (this->candidate_layout) {
		QHBoxLayout * d = this->candidate_layout;
		this->candidate_layout = NULL;
		delete d;
	}

	if (this->option_layout) {
		QVBoxLayout * d = this->option_layout;
		this->option_layout = NULL;
		delete d;
	}

	if (this->writor_layout) {
		QHBoxLayout * d = this->writor_layout;
		this->writor_layout = NULL;
		delete d;
	}

	if (this->master_layout) {
		QVBoxLayout * d = this->master_layout;
		this->master_layout = NULL;
		delete d;
	}

	if (this->recognizer) {
		zinnia_recognizer_t * d = this->recognizer;
		this->recognizer = NULL;
		(void)zinnia_recognizer_close(d);
		(void)zinnia_recognizer_destroy(d);
	}

	this->destroyed = true;
	return 0;
} /* handwritor::destroy */
/*
 * Class:     com_key_handwrite_Zinnia
 * Method:    zinnia_recognizer_close
 * Signature: (J)I
 */
JNIEXPORT jint JNICALL Java_com_key_handwrite_Zinnia_zinnia_1recognizer_1close
(JNIEnv *env, jobject jobj, jlong recognizer)
{
    zinnia_recognizer_t* p = reinterpret_cast<zinnia_recognizer_t*>(recognizer);
    return zinnia_recognizer_close(p);
}