# This patch file was generated by NetBeans IDE
# This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
# It uses platform neutral UTF-8 encoding.
# Above lines and this line are ignored by the patching process.
--- /home/bogdan/mobile_tools-6.x-1.12/mobile_tools.module
+++ /var/www/drupal6test.bog/sites/all/modules/mobile_tools/mobile_tools.module
@@ -90,15 +90,6 @@
   return $items;
 } 
 /**
- * Implementation of hook_exit();
- */ 
-function mobile_tools_exit() {
-  // FIX ME: check what cases don't need this. Bad for performance
-  if (variable_get('mobile-tools-theme-switch', '') == 'mobile-tools-mobile-device') {
-    cache_clear_all(NULL, 'cache_page', TRUE);
-  }
-}
-/**
  *  Implementation of hook_boot().
  */ 
 function mobile_tools_boot() {
@@ -602,9 +593,6 @@
  */ 
 function mobile_tools_themes_boot() {
   global $conf;
-  if (variable_get('mobile-tools-theme-switch', '') == 'mobile-tools-mobile-device') {
-    cache_clear_all(NULL, 'cache_page', TRUE);
-  }
   if ( ($_SESSION['mobile-tools-site-type'] == 'mobile' &&  variable_get('mobile-tools-theme-switch', ''  ) == 'mobile-tools-mobile-url') || (variable_get('mobile-tools-theme-switch', ''  ) == 'mobile-tools-mobile-device' && $_SESSION['mobile-tools-mobile-device']['type']  == 'mobile') ) {
     global $conf;
     $group = $_SESSION['mobile-tools-mobile-device']['group'];
@@ -612,6 +600,9 @@
     $mobile_detection_module = variable_get('mobile-tools-device-detection', 'mobile_tools');
     if (variable_get($mobile_detection_module . '_' . $group . '_enable', '') == 1) {
       $conf['theme_default'] = variable_get($mobile_detection_module . '_' . $group . '_theme', $conf['theme_default']);
+			if (variable_get('mobile-tools-theme-switch', '') == 'mobile-tools-mobile-device') {
+				cache_clear_all(NULL, 'cache_page', TRUE);
+			}
       return TRUE;
     } 
     else {
