Changeset 3999

Show
Ignore:
Timestamp:
03/29/06 00:21:35 (3 years ago)
Author:
morris
Message:

Copy the topic when modifying it instead

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • wire/trunk/wire/windows.c

    r3998 r3999  
    124124        window->type            = WR_WINDOW_TYPE_USER; 
    125125        window->uid                     = user->uid; 
    126         window->topic.topic     = wi_copy(user->nick); 
     126        window->topic.topic     = wi_retain(user->nick); 
    127127         
    128128        return window; 
     
    616616        wi_size_t               size; 
    617617         
    618         topic = wr_current_window->topic.topic
     618        topic = wi_copy(wr_current_window->topic.topic)
    619619         
    620620        if(!topic) 
    621                 topic = wi_string_with_cstring(""); 
     621                topic = wi_string_init(wi_string_alloc()); 
    622622 
    623623        wi_terminal_adjust_string_to_fit_width(wr_terminal, topic); 
     
    630630           WR_END_COLOR); 
    631631        wi_terminal_move(wr_terminal, wi_make_point(rl_point % size.width, size.height - 1)); 
     632         
     633        wi_release(topic); 
    632634} 
    633635