[gedit-list] Python plugin crash on file open.



Hi,

The attached python example plugin crashes gedit 2.18.1.
I don't see that it'd be a problem with the plugin.
The output is this:

activate
Plugin created
Plugin updated
Plugin updated
sys:1: GtkWarning: gtk_accel_label_set_accel_closure: assertion
`gtk_accel_group_from_accel_closure (accel_closure) != NULL' failed
hello
<gedit.Tab object (GeditTab) at 0x847f0cc>
Plugin updated

** (gedit:13101): CRITICAL **: document_loading: assertion
`(tab->priv->state == GEDIT_TAB_STATE_LOADING) || (tab->priv->state ==
GEDIT_TAB_STATE_REVERTING)' failed
Plugin updated
Plugin updated
Segmentation fault (core dumped)

Could anyone take a look?
Is it the plugin that does something nasty?
It crashes at line 29.

Thanks,
Gabor
-- 
  Gabor Fekete
  feketga2 fastmail fm

-- 
http://www.fastmail.fm - A no graphics, no pop-ups email service

from gettext import gettext as _
import gtk
import gedit
import gobject

class Cece(object):
	def __init__(self, plugin, geditWindow):
		print "Plugin created"
		#print "iiii ok"
		self.geditWindow = geditWindow
		self.plugin = plugin
		gobject.timeout_add(2000, self.dummy)
	
	def deactivate(self):
		print "Plugin deactivated"

	def dummy(self):
		print "hello"
		#self.geditWindow.create_tab_from_uri("file:///home/feketgab/.vimrc",
			#gedit.encoding_get_from_charset("utf-8"),
			##None,
			#12, False, True)
		tab = self.geditWindow.get_active_tab()
		if tab == None:
			print "Tab is NULL!"
		print tab
		doc = tab.get_document()
		doc.load("file:///home/feher/.vimrc",
			gedit.encoding_get_from_charset("utf-8"), 1, False)
		return False

	def update_ui(self):
		print "Plugin updated"
	
class CeceMain(gedit.Plugin):
	def __init__(self):
		gedit.Plugin.__init__(self)
		self.instances = {}

	def activate(self, geditWindow):
		print "activate"
		self.instances[geditWindow] = Cece(self, geditWindow)

	def deactivate(self, geditWindow):
		print "main deactivate"
		self.instances[geditWindow].deactivate()
		del self.instances[geditWindow]

	def update_ui(self, geditWindow):
		self.instances[geditWindow].update_ui()

Attachment: cece.gedit-plugin
Description: Binary data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]