[Groonga-commit] groonga/grngo at b0f465e [master] Unlink a table object only when it is valid.

Back to archive index

susumu.yata null+****@clear*****
Wed Jul 8 21:12:33 JST 2015


susumu.yata	2015-07-08 21:12:33 +0900 (Wed, 08 Jul 2015)

  New Revision: b0f465e193d61b727b6a4edc5ad54b2384925e96
  https://github.com/groonga/grngo/commit/b0f465e193d61b727b6a4edc5ad54b2384925e96

  Message:
    Unlink a table object only when it is valid.
    
    GitHub: #10

  Modified files:
    grngo.go

  Modified: grngo.go (+6 -0)
===================================================================
--- grngo.go    2015-07-08 21:02:06 +0900 (df3e737)
+++ grngo.go    2015-07-08 21:12:33 +0900 (ab530dd)
@@ -339,6 +339,12 @@ func (db *DB) Close() error {
 // that.
 func (db *DB) Refresh() error {
 	for _, table := range db.tables {
+		nameBytes := []byte(table.name)
+		cName := (*C.char)(unsafe.Pointer(&nameBytes[0]))
+		tableObj := C.grngo_find_table(db.ctx, cName, C.int(len(nameBytes)))
+		if tableObj != table.obj {
+			continue
+		}
 		for _, column := range table.columns {
 			nameBytes := []byte(column.name)
 			cName := (*C.char)(unsafe.Pointer(&nameBytes[0]))
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index