TclStackFree: incorrect freePtr. Call out of sequence?


I have a piece of code that graphs streaming data in a new window. If the
cursor is within the graphing window and the cursor has been moved after the
command has been sent to start graphing data, the graphing window would
crash and the message says that "python.exe has stopped working".
In the CMD window, the following error is displayed:
"TclStackFree: incorrect freePtr. Call out of sequence?
This application has requested the Runtime to terminate it in an unusual
Please contact the application's support team for more information."
I've tried changing from python 2.7.7 to 2.7.8 and matplotlib-1.3.1 to
1.4.2. The problem persists in both cases.
Any help or insight would be greatly appreciated.
Thank you.

Python code used pertaining to graphing streaming data:

def start():
  global ekg_data
  global ekg_lock
  ekg_lock = Lock()
  ekg_data = Queue()
  conn.register_notification(Handle_EKG, Handle_EKG_Notify,
  conn.GATT_WriteCharValue(handle=Handle_StartSweep, value=StartEKG_Value)
  t = Thread(target=ekg_plotter)
  t.daemon = True
def ekg_plotter():
  global ekg_data
  global ekg_lock
  graph_data = zeros(2000)
  graph, = plot(graph_data)
  while (True):
    newData = []
    with ekg_lock:
      size_q = ekg_data.get()
      graph_data = np.concatenate((graph_data[(len(size_q)):], size_q))

def ekg_data_ready(packet_dictionary):
  global ekg_data
  global ekg_lock
  packet, dictionary = packet_dictionary
  data = dictionary["values"][0]
  dataList = [data[i:i+EKG_DATA_SIZE] for i in range(0, len(data),
  parsedList = [unpack("<b", x)[0] for x in dataList]
  with ekg_lock:


View this message in context:
Sent from the matplotlib - devel mailing list archive at