how to stop a view from executing within a views hook I am using custom code with a views pre_execute and i want the view to return an empty set if certain conditions are met , or not to return the view at all. 
how can i do this ?  this is what i tried.

function mymodule_views_pre_execute(&amp;$view) { 
   // if certain conditions are met i want this view to be empty or not come out at all
  if ($myconditions){
   $view = null;  
  }
}
this worked for me, i unset all the results and the view disappeared 

foreach ($view-&gt;result as $key =&gt; $value) {
    unset ($view-&gt;result[$key]); // delete a row

  }