Segmentation Fault when updating cocos.text.Label.element.text (Python/Pyglet/Cocos) -


i have python/cocos application (among other things) receives events through bus , displays relevant information on screen.

i have cocos.text.label displays value coming remote sensor. when try , update label new value setting label's element.text segmentation fault.

in actual code other things use value without issues, confident it's problem cocos.text.label, segmentation fault happens when update triggered bus rather key press event or similar.

below minimal example exhibits same behaviour:

#!/usr/bin/python  import cocos import functools import pyglet import remotes # proprietary library getting events through remote event bus  class testlayer(cocos.layer.layer, pyglet.event.eventdispatcher):     is_event_handler = true  def __init__(self):     super(testlayer, self).__init__()      self.bus = remotes.remoteeventbus()      widget = remotes.remotewidget("force", self.bus, none)     widget.set_on_value_listener(functools.partial(self.on_value_change))      self.label_value = 0.0     self.label = cocos.text.label(text=str(self.label_value))     self.add(self.label)  def on_value_change(self, event):     # normalised_value between 0.0 , ~1.1     self.update_label(int(event.normalized_value * 100))  def on_key_press(self, key, modifiers):     self.update_label(key)  def update_label(self, value):     self.label_value = value     ### segfault here (sometimes     self.label.element.text = str(self.label_value)   if __name__ == "__main__":     cocos.director.director.init(width=320, height=240, caption="segfault test",  fullscreen=false)      test_layer = testlayer()     main_scene = cocos.scene.scene(test_layer)      cocos.director.director.run(main_scene) 

it if value passed label affects whether or not segfaults, can't work out why. what might causing behaviour?

apologies use of proprietary libraries, i'm working on reproducing problem without it, far without luck.


Comments

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

angular - DownloadURL return null in below code -

php - Cannot override Laravel Spark authentication with own implementation -