Changeset 9190285
- Timestamp:
- Sep 18, 2010, 5:07:40 PM (14 years ago)
- Branches:
- master, release-1.10, release-1.7, release-1.8, release-1.9
- Children:
- c394de8
- Parents:
- 08263a8
- git-author:
- David Benjamin <davidben@mit.edu> (08/14/10 00:54:38)
- git-committer:
- David Benjamin <davidben@mit.edu> (09/18/10 17:07:40)
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
commands.c
r9eb38bb r9190285 2693 2693 2694 2694 owl_global_set_typwin_inactive(&g); 2695 owl_editwin_ delete(e);2695 owl_editwin_unref(e); 2696 2696 } 2697 2697 … … 2750 2750 2751 2751 owl_editwin_do_callback(e); 2752 owl_editwin_ delete(e);2752 owl_editwin_unref(e); 2753 2753 } 2754 2754 -
editwin.c
r08263a8 r9190285 17 17 18 18 struct _owl_editwin { /*noproto*/ 19 int refcount; 19 20 char *buff; 20 21 owl_history *hist; … … 74 75 e = owl_malloc(sizeof(owl_editwin)); 75 76 memset(e, 0, sizeof(*e)); 77 e->refcount = 1; 76 78 return e; 77 79 } 78 80 79 voidowl_editwin_delete(owl_editwin *e)81 static void _owl_editwin_delete(owl_editwin *e) 80 82 { 81 83 if (e->win) { … … 153 155 oe_set_window(e, win, winlines, wincols); 154 156 return e; 157 } 158 159 owl_editwin *owl_editwin_ref(owl_editwin *e) 160 { 161 e->refcount++; 162 return e; 163 } 164 165 void owl_editwin_unref(owl_editwin *e) 166 { 167 e->refcount--; 168 if (e->refcount <= 0) 169 _owl_editwin_delete(e); 155 170 } 156 171 -
tester.c
r7ba2ad4 r9190285 390 390 "blah")); 391 391 392 owl_editwin_ delete(oe); oe = NULL;392 owl_editwin_unref(oe); oe = NULL; 393 393 oe = owl_editwin_new(NULL, 80, 80, OWL_EDITWIN_STYLE_MULTILINE, NULL); 394 394 … … 403 403 "blah")); 404 404 405 owl_editwin_ delete(oe); oe = NULL;405 owl_editwin_unref(oe); oe = NULL; 406 406 407 407 /* Test owl_editwin_move_to_beginning_of_line. */ … … 425 425 FAIL_UNLESS("find beginning of line after empty middle line", 426 426 owl_editwin_move_to_beginning_of_line(oe) == -2); 427 owl_editwin_ delete(oe); oe = NULL;427 owl_editwin_unref(oe); oe = NULL; 428 428 429 429 printf("# END testing owl_editwin (%d failures)\n", numfailed);
Note: See TracChangeset
for help on using the changeset viewer.