Commit e300e50281fba6ff4b2fd51b2396c4c32d36f5b7

Kano 2013-06-19T11:59:28

disable curses device resize that crashes on windows

diff --git a/cgminer.c b/cgminer.c
index 4f3a2f7..059bddb 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -7128,8 +7128,11 @@ struct _cgpu_devid_counter {
 
 static void adjust_mostdevs(void)
 {
+// device window resize crashes on windows - disable resize now
+#ifndef WIN32
 	if (total_devices - zombie_devs > most_devices)
 		most_devices = total_devices - zombie_devs;
+#endif
 }
 
 bool add_cgpu(struct cgpu_info *cgpu)
@@ -7565,13 +7568,20 @@ int main(int argc, char *argv[])
 		quit(1, "All devices disabled, cannot mine!");
 #endif
 
+// device window resize crashes on windows - disable resize now
+#ifdef WIN32
+	most_devices = total_devices + 1; // Allow space for 1 hotplug
+#else
+	most_devices = total_devices;
+#endif
+
 	load_temp_cutoffs();
 
 	for (i = 0; i < total_devices; ++i)
 		devices[i]->cgminer_stats.getwork_wait_min.tv_sec = MIN_SEC_UNSET;
 
 	if (!opt_compact) {
-		logstart += total_devices;
+		logstart += most_devices;
 		logcursor = logstart + 1;
 #ifdef HAVE_CURSES
 		check_winsizes();