comparison libpurple/ft.c @ 31405:193cbfcfc935

merged from im.pidgin.pidgin
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Tue, 23 Nov 2010 20:02:24 +0900
parents a76cf8ecb0c5
children a8cc50c2279f
comparison
equal deleted inserted replaced
31368:29b4f2c52533 31405:193cbfcfc935
1485 { 1485 {
1486 PurpleXferUiOps *ui_ops; 1486 PurpleXferUiOps *ui_ops;
1487 char *msg = NULL; 1487 char *msg = NULL;
1488 1488
1489 g_return_if_fail(xfer != NULL); 1489 g_return_if_fail(xfer != NULL);
1490
1491 /* TODO: We definitely want to close any open request dialogs associated
1492 with this transfer. However, in some cases the request dialog might
1493 own a reference on the xfer. This happens at least with the "%s wants
1494 to send you %s" dialog from purple_xfer_ask_recv(). In these cases
1495 the ref count will not be decremented when the request dialog is
1496 closed, so the ref count will never reach 0 and the xfer will never
1497 be freed. This is a memleak and should be fixed. It's not clear what
1498 the correct fix is. Probably requests should have a destroy function
1499 that is called when the request is destroyed. But also, ref counting
1500 xfer objects makes this code REALLY complicated. An alternate fix is
1501 to not ref count and instead just make sure the object still exists
1502 when we try to use it. */
1503 purple_request_close_with_handle(xfer);
1490 1504
1491 purple_xfer_set_status(xfer, PURPLE_XFER_STATUS_CANCEL_LOCAL); 1505 purple_xfer_set_status(xfer, PURPLE_XFER_STATUS_CANCEL_LOCAL);
1492 xfer->end_time = time(NULL); 1506 xfer->end_time = time(NULL);
1493 1507
1494 if (purple_xfer_get_filename(xfer) != NULL) 1508 if (purple_xfer_get_filename(xfer) != NULL)