library/src/blockclass/BP-BlockClass.cc
// Destroys the authenticated user data stored within this->user_info.  Pointer
// is nullified after it's destroyed.
Destroys the authenticated user data stored within this->user_info.  Pointer
is nullified after it's destroyed.
Destroys the authenticated user data stored within this - > user_info . Pointer is nullified after it ' s destroyed .
BP_ERROR_T Block::destroyAuthUserData()
{
	if(this->user_info)
	{
		if(this->user_info->first_name)
			tq_free(this->tq, this->user_info->first_name);
		if(this->user_info->last_name)
			tq_free(this->tq, this->user_info->last_name);
		if(this->user_info->email)
			tq_free(this->tq, this->user_info->email);
		if(this->user_info->username)
			tq_free(this->tq, this->user_info->username);
		if(this->user_info->created)
			tq_free(this->tq, this->user_info->created);
		if(this->user_info->role)
			tq_free(this->tq, this->user_info->role);
		tq_free(this->tq, this->user_info);
		this->user_info = NULL;
	}
	this->mysqlDestroyStatement();
	return ERR_SUCCESS;
}
BP_ERROR_T Block :: destroyAuthUserData ( ) { if ( this -> user_info ) { if ( this -> user_info -> first_name ) tq_free ( this -> tq , this -> user_info -> first_name ) ; if ( this -> user_info -> last_name ) tq_free ( this -> tq , this -> user_info -> last_name ) ; if ( this -> user_info -> email ) tq_free ( this -> tq , this -> user_info -> email ) ; if ( this -> user_info -> username ) tq_free ( this -> tq , this -> user_info -> username ) ; if ( this -> user_info -> created ) tq_free ( this -> tq , this -> user_info -> created ) ; if ( this -> user_info -> role ) tq_free ( this -> tq , this -> user_info -> role ) ; tq_free ( this -> tq , this -> user_info ) ; this -> user_info = NULL ; } this -> mysqlDestroyStatement ( ) ; return ERR_SUCCESS ; }
Destroys the authenticated user data stored within this->user_info.
Destroys the authenticated user data stored within this - > user_info .
// destroy the user info if it's already set // destroy the user info // nullify the pointer // destroy the statement // return indicating success